-100 10 50 20 70 60 30 80 100 90
Insert(40)
is called.DeleteMin()
is called.DecreaseKey()
is
called on the node with value 100 to lower it to 35.IncreaseKey()
is
called on the node with value 20 to raise it to 85.
(a) BinTreeIsHeap(Tree T)
that returns whether or not
a binary tree of integers meets the heap ordering criteria (C++ folks
should make this a method of the Tree class...). You should assume
that the tree structure is the same as in Assignment 3, problem 3, and
that you will need to refer to the internal structure. You may also
assume that the tree is complete, so you don't need to check that it
has the correct shape.
(b) ArrayIsHeap(int *arr,int size)
that returns
whether or not an array is a legal heap (size
indicates
the number of elements in the array). You may assume that the array
starts at position 1 rather than 0.