Code (in Java) for Princeton-Algorithms.
ps. p = examples, e = exercises, cp = creative problems, we = web exercises;
# |
Code |
Summary |
example |
RedBlackTree |
implementation of symbol table based on red-black BST |
# |
Code |
Summary |
example |
BST |
implementation of symbol table using binary search tree(BST) |
# |
Code |
Summary |
exercises 2 |
Array_ST |
implementation of symbol table based on array |
exercises 1 |
GPA |
using symbol table to calculate the total GPA of list of grades |
# |
Code |
Summary |
example |
Heap |
implementation of heap andheap-sort |
# |
Code |
Summary |
example |
QuickSort |
implementation of quick-sort |
# |
Code |
Summary |
example |
MergeSort |
implementation of merge-sort, including top-down & buttom-up |
# |
Code |
Summary |
creative problems 22 |
sort_transactions |
an application of sort |
example |
VisualSort |
visualization of sorting process |
example |
Sort |
implementation of selection-sort, insertion-sort and shell-sort |
# |
Code |
Summary |
creative problems 18,19 |
local_minimum |
find the local minimum for array or matrix |
example |
TwoSum |
use binary search to make it faster for 2-Sum problem |
example |
Stopwatch |
get the run time of program |
# |
Code |
Summary |
creative problems 37 |
josephus_problem |
use queue (linked-list) to solve the Josephus problem |
exercises 5 |
print_binary |
use stack to get the binary of an integer |
exercises 4 |
parentheses |
use stack to check parentheses form |
exercises 1 |
fixed_capacity_stack |
build a fixed capacity stack |
example |
Bag |
use bag class to implement linked-list |
example |
Stack |
use stack class to implement linked-list |
example |
Queue |
use queue class to implement linked-list |
example |
Reverse |
use stack to operate an array of numbers |
example |
Stats |
use bag to operate a set of numbers |
# |
Code |
Summary |
exercises 1 |
Point2D |
find the distence of the closest pair of 2D points. |