Explain how an element is added to a maxheap.
What will be an ideal response?
An element is added to a heap as a leaf, and then it is moved up the tree until the tree has the heap property
again. This means it is moved up the tree until it is smaller than its parent node, and all of its children are smaller than it.
You might also like to view...
MC Inheritance represents a(n)______ relationship.
a) has-a. b) is-a. c) uses. d) None of the above.
Which of the following statements about try blocks is true?
a. The try block must be followed by at least one catch block. b. The try block must be followed by a finally block. c. The try block should contain statements that may process an exception. d. The try block should contain statements that may throw an exception.
For which of the following types of files do you need to specify a value for the classid attribute in the
A. inline images B. video files C. Java applets D. All of the above
If the superclass contains only abstract method declarations, the superclass is used for ________.
a. implementation inheritance. b. interface inheritance. c. Both. d. Neither.