JMCanning78 / DemoRepo

0 stars 0 forks source link

Add Operations to Heap visualization #40

Open JMCanning78 opened 4 years ago

JMCanning78 commented 4 years ago

Add animated operations to the basic Heap VisualizationApp visualizing just the array representation of the heap. We'll add the tree visualization separately.

Implement animated methods for:

Peek should copy the first element of the array to the bottom of the canvas, like the Traverse operation in Array.py. The value should be labeled "Root". The Remove Max should also animate copying the first element of the array to the Root result, and then animate the process of moving the last element to the first element of the array, reducing nItems, and then sifting the first item down.

Random Fill should take a number, 1-31, as an argument, create an array of that size, fill it with random numbers in the range 0-99, and place the nItems at 1 to indicate only the first item in the array meets the heap condition. The Heapify button should only be enabled when the number of items in the array exceeds nItems. When Heapify is run it organizes the items in the array into a heap using sift down and finishes by setting nItems to include all the items in the array (disabling the Heapify button).

JMCanning78 commented 4 years ago

This issue depends on issue: #38.

JMCanning78 commented 4 years ago

This issue relates to #39, #41.

JMCanning78 commented 4 years ago

This issue relates to #39, #41.