Due: Tuesday March 12, 2008
Convert quicksort into code, like we discussed in review class. Make it sort the Song object by the title field.
void quicksort( ArrayList<Song> A )
void quicksort( ArrayList<Song> A, int left, int right )
int partition( ArrayList<Song> A, int left, int right )
void swap( ArrayList<Song> A, int i, int j )
Create an insert function that will insert a linked list into a preexisting linked list. An example would be if [1, 2, 3, 4] were to be inserted into [0, 2, 4, 5] at position 2, the resulting linked list would be [0, 2, 1, 2, 3, 4, 4, 5].
void insert(Node D)
Write a function that converts a tree into a binary search tree... any tree into a binary search tree. Hint: recreate the tree using functions discussed in class (not on lecture slides but should be in your notebooks).
void ConvertToBST( )
Implement heapify in Java for an array of TreeNode objects.
void heapify( ArrayList<TreeNode> A )
void siftDown( ArrayList<TreeNode> A, int start, int end)
Refer to the Wikipedia link in the lecture slide for the pseudocode.