Skip to content
Snippets Groups Projects
Commit a5586bb7 authored by Yanis O's avatar Yanis O
Browse files

Ajout de la structure de donnée Matrix

parent 81b0fd6a
No related branches found
No related tags found
No related merge requests found
package util;
import java.util.ArrayList;
public class Matrix<E> {
private ArrayList<ArrayList<E>> matrix;
public Matrix(){
this.matrix = new ArrayList<ArrayList<E>>();
}
public E get(int x, int y){
return matrix.get(x).get(y);
}
public E set(int x, int y, E object){
return matrix.get(x).set(y, object);
}
public int size(){
return matrix != null ? matrix.get(0).size()*matrix.size() : 0;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment