Think about this stuff:
private ArrayList elements = new ArrayList<>();private Comparator comparator = (E1, E2) -> (E1.compareTo(E2));public Heap() {super();elements.add(null);}public Heap( Comparator comparator) {super();this.comparator = comparator ;elements.add(null);}Completeint percolateUp(int index)int percolatDown(int index)That's right two methods.... Just two.Also pass the unit tests. Run main for fun and all.
Complete
int percolateUp(int index)
int percolatDown(int index)
That's right two methods.... Just two.
Also pass the unit tests. Run main for fun and all.
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here