This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @Override | |
| public E remove(int index) throws IndexOutOfBoundsException{ | |
| if (index >= size || index < 0) throw new IndexOutOfBoundsException(); | |
| Node<E> prev = null, temp = head; | |
| E data; | |
| int a = 0; | |
| // Set temp to the node to be deleted | |
| while(a != index) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @Override | |
| public E remove(int index) throws IndexOutOfBoundsException{ | |
| if (index >= size || index < 0) throw new IndexOutOfBoundsException(); | |
| Node<E> prev = null, temp = head; | |
| E data; | |
| int a = 0; | |
| // Set temp to the node to be deleted | |
| while(a != index) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| assertTrue(list.remove(0).equals(j)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import static org.junit.Assert.*; | |
| import org.junit.Test; | |
| import org.junit.Before; | |
| import java.util.ArrayList; | |
| /** | |
| * Linked List Tests | |
| * @author Chintan |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import static org.junit.Assert.*; | |
| import org.junit.Test; | |
| import org.junit.Ignore; | |
| import org.junit.Before; | |
| import java.util.ArrayList; | |
| public class BSTTest { | |
| private BST<Integer> tree; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.util.Collection; | |
| import java.util.List; | |
| public class BST<T extends Comparable<T>> { | |
| private Node<T> root; | |
| private int size; | |
| public enum Side { LEFT, RIGHT }; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import static org.junit.Assert.*; | |
| import org.junit.Test; | |
| import org.junit.Ignore; | |
| import org.junit.Before; | |
| import java.util.ArrayList; | |
| public class BSTTest { | |
| private BST<Integer> tree; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import static org.junit.Assert.*; | |
| import org.junit.Test; | |
| import org.junit.Ignore; | |
| import org.junit.Before; | |
| import java.util.ArrayList; | |
| public class BSTTest { | |
| private BST<Integer> tree; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import static org.junit.Assert.*; | |
| import org.junit.Test; | |
| import org.junit.Ignore; | |
| import org.junit.Before; | |
| import java.util.ArrayList; | |
| public class BSTTest { | |
| private BST<Integer> tree; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.util.Collection; | |
| import java.util.List; | |
| import java.util.ArrayList; | |
| import java.util.Stack; | |
| public class BST<T extends Comparable<T>> { | |
| private Node<T> root; | |
| private int size; | |
| public enum Side { LEFT, RIGHT }; |