Skip to content

Instantly share code, notes, and snippets.

View calindotgabriel's full-sized avatar
🦁
typing...

Calin Gabriel calindotgabriel

🦁
typing...
  • Endava
  • Cluj-Napoca
View GitHub Profile
import junit.framework.TestCase;
import java.util.Iterator;
/**
* Created by motan on 23.06.2015.
*/
public class TestIterator extends TestCase {
public void testIterator() {
import junit.framework.TestCase;
/**
* Created by motan on 23.06.2015.
*/
public class TestBst extends TestCase {
public void testInsert() {
BinarySearchTree<Integer> tree = new BinarySearchTree<Integer>();
import java.util.Iterator;
import java.util.Stack;
/**
* Created by motan on 23.06.2015.
*/
public class BstIterator<T> implements Iterator<T> {
Stack<Node<T>> stk = new Stack<Node<T>>();
import java.util.Iterator;
import java.util.Stack;
/**
* Created by motan on 23.06.2015.
*/
public class BstIterator<T> implements Iterator<T> {
Stack<Node<T>> stk = new Stack<Node<T>>();
import java.util.Comparator;
import java.util.Iterator;
/**
* Created by motan on 23.06.2015.
*/
public class BinarySearchTree<T extends Comparable<T>> implements Iterable<T>{
private Node<T> root;
private Comparator<T> comparator;
import junit.framework.TestCase;
/**
* Created by motan on 23.06.2015.
*/
public class TestBst extends TestCase {
public void testInsert() {
BinarySearchTree<Integer> tree = new BinarySearchTree<Integer>();
import java.util.Comparator;
import java.util.Iterator;
/**
* Created by motan on 23.06.2015.
*/
public class BinarySearchTree<T extends Comparable<T>> {
private Node<T> root;
private Comparator<T> comparator;
/**
* Created by motan on 23.06.2015.
*/
public class Node<T> {
public T data;
public Node<T> left, right;
public Node(T data, Node<T> left, Node<T> right) {
this.data = data;
<?xml version="1.0"?>
<config>
<modules>
<Inspiricon_Personalize>
<version>0.1.0</version>
</Inspiricon_Personalize>
</modules>
</config>
<?xml version="1.0"?>
<config>
<modules>
<Inspiricon_Personalize>
<active>true</active>
<codePool>local</codePool>
</Inspiricon_Personalize>
</modules>
</config>