What properties does a heap share with a binary tree?
What will be an ideal response?
A heap is a binary tree, in that it is a series of nodes in which each node has links to 0, 1, or two other nodes,
and such that each node has at most one other node linking to it. It uses the methods defined in the Binary Tree interface.
You might also like to view...
Letterhead is printed stationary that includes an organizaton's contact information and/or logo
Indicate whether the statement is true or false
Handouts exported from PowerPoint to Word are saved with a(n) ________ file extension
Fill in the blank(s) with correct word
What is wrong with the following compare function to used by the ADT?bool compareStu (void* stu1, void* stu2){ STUDENT s1; STUDENT s2; s1 = *(STUDENT*)stu1; s2 = *(STUDENT*)stu2; if ( s1.id != s2.id) return false; return true;}
A. It should return low (-1), equal (0), or high (+1). B. s1 and s2 should be defined as STUDENT *s1 and STUDENT *s2. C. The assignment of s1 should be written as "s1 = *(STUDENT)stu1"; the same for s2. D. The id field should be referenced as "s1->id" and "s2->id".
A node that contains one data item and has two children is called a ______.
a) 1-node b) 2-node c) single node d) double node