The purpose of this assignment is to learn to
You will generate a visualization that illustrates the hash table and tree representations used in the assignment.
The purpose of the assignment is to analyze out of Shakespeare works which words are used most often. The assignment is in two pieces. First, we will need to count how many times each words appear. This will be accomplished using a Dictionary implemented as a Binary Search Tree. Then, we will extract the words used most often. This will be accomplished using a Min Heap.
A Dictionary (sometimes called associative arrays) enable to store and retrieve (key, value) pairs. In this assignment they will be useful to count how many times a particular word appear in Shakespeare's work. The keys are going to be words. And the value associated with that key is going to be how many times that word appears. Counting the words then becomes:
The purpose of this task is to build a MinHeap in BRIDGES represented as a binary tree (as opposed to the more common array representation of a heap)
Recall that as a binary tree, a heap defined recursively as a root and two subheaps. The invariant of a min heap is that the root of any heap should have a lower (or equal) key than any node contained in the heap.
MyHeapElement
class that extends BRIDGES's BinTreeElement
.MyHeap
class that provide Min Heap features.The algorithm for inserting in a heap is as follows. (This algorithm ignores that there is a key and a value.) Note that it uses information about the size of the subheaps being stored at each node of the heap.
Write a pop function that return the element with the lowest key.
Use the heap to identify the most occuring words in Shakespeare work.