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();
    }
 
}
개인 도구
이름공간
변수
행위
둘러보기
구성원
연구
연구실
기타
도구모음
인쇄/내보내기