001package algs15.perc;
002
003//import stdlib.*;
004//import algs15.*;
005
006// Uncomment the import statements above.
007
008// You can test this using InteractivePercolationVisualizer and PercolationVisualizer
009// All methods should make at most a constant number of calls to a UF data structure.
010// You can use more than one UF data structure.
011// You can assume that N>1
012public class Percolation {
013        int N;
014        boolean[] open;
015        // TODO: more fields to add here
016        public Percolation(int N) {
017                if (N < 2) throw new IllegalArgumentException();
018                this.N = N;
019                this.open = new boolean[N*N];
020                // TODO: more to do here
021        }
022        // open site (row i, column j) if it is not already
023        public void open(int i, int j) {
024                open[i*N+j] = true;
025                // TODO: more to do here.
026        }
027        // is site (row i, column j) open?
028        public boolean isOpen(int i, int j) {
029                return open[i*N+j];
030        }
031        // is site (row i, column j) full?
032        public boolean isFull(int i, int j) {
033                // TODO
034                return false;
035        }
036        // does the system percolate?
037        public boolean percolates() {
038                // TODO
039                return false;
040        }
041}