This file contains 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
the | |
of | |
and | |
to | |
a | |
in | |
for | |
is | |
on | |
that |
This file contains 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
.gradle | |
/local.properties | |
/.idea/workspace.xml | |
/.idea/libraries | |
.DS_Store | |
/build |
This file contains 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
//---------------------------------------------------- | |
protected void iterativeWalk(Visitor v) | |
{ | |
Node node = root; | |
if (node != nil) { | |
while (node.left != nil) { | |
node = node.left; | |
} | |
This file contains 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
public class FibStack { | |
public static void main(String[] args) { | |
System.out.println(getFib(12)); | |
} | |
public static int getFib(int n) | |
{ | |
if (n == 0) return 0; | |
if (n == 1) return 1; |
This file contains 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.Arrays; | |
import java.util.Comparator; | |
public class AnonymousComparator { | |
public static void main(String[] args) { | |
String[] array = {"car", "apple", "house", "awesome", "breban", "compsci", "yeshiva", "university"}; | |
Arrays.sort(array, new Comparator<String>() { |
This file contains 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
public class StackList { | |
StackListNode first; | |
int size; | |
public static void main(String[] args) { | |
StackList list = new StackList(); | |
list.push(1); |
This file contains 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.Arrays; | |
public class QueensBrute { | |
public static void main(String[] args) { | |
run(); | |
} | |
public static void run() | |
{ |
This file contains 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
public class HeapSort { | |
public static void sort(int[] a) | |
{ | |
int heapSize = a.length-1; | |
buildMaxHeap(a, heapSize); | |
while (heapSize > 0) { | |
swap(a, 0, heapSize); | |
heapSize--; |
This file contains 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
package com.abraham.trees; | |
public class BinarySearchTree<E extends Comparable<E>> extends BinaryTree<E> { | |
protected Node<E> root; | |
protected Node<E> nil; | |
public static void main(String[] args) { | |
BinarySearchTree<Integer> bt = new BinarySearchTree<Integer>(); | |