Lecture/자료구조/2011/알고리즘 3.2
Retired DISLab
SlowSparseMatrix.java
public class SlowSparseMatrix extends SparseMatrix { public SlowSparseMatrix(int rows, int cols, int terms) { super(rows, cols, terms); // TODO Auto-generated constructor stub } @Override public SparseMatrix transpose() { // TODO return null; } }
SparseTrans2.java
public class SparseTrans2 { public static void main(String[] args) { SparseMatrix b; SparseMatrix a = new SlowSparseMatrix(7, 6, 8); a.storeTriple(0, 0, 76); a.storeTriple(0, 4, 13); a.storeTriple(2, 5, 3); a.storeTriple(3, 1, 25); a.storeTriple(4, 0, -19); a.storeTriple(4, 3, 56); a.storeTriple(5, 5, 13); a.storeTriple(6, 2, 13); a.displayMatrix(); b = a.transpose(); b.displayMatrix(); } }