Skip to content

Instantly share code, notes, and snippets.

View chintanparikh's full-sized avatar
🎯
Focusing

Chintan Parikh chintanparikh

🎯
Focusing
View GitHub Profile
@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)
@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)
assertTrue(list.remove(0).equals(j));
import static org.junit.Assert.*;
import org.junit.Test;
import org.junit.Before;
import java.util.ArrayList;
/**
* Linked List Tests
* @author Chintan
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;
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 };
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;
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;
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;
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 };