Question

6. T or F: There can be two or more nodes in a heap with exactly...

6. T or F: There can be two or more nodes in a heap with exactly one child.
7. T or F: A heap can have no nodes with exactly one child.
8. T or F: All heaps are perfect trees.
9. T or F: No heaps are perfect trees.
10. T or F: All heaps are complete trees.
11. T or F: No heaps are complete trees.
12. T or F: A binary tree with one node must be a heap.
13. T or F: A binary tree with two nodes and with the root having the smallest value must be a min-heap.
14. T or F: If a node in a heap is a right child and has two children, then its sibling must also have two children.
15. T or F: If a node in a heap is a right child and has one child, then its sibling must also have one child.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

6.False(a heap can have only one node with one child )

7.False(the heap can have one node with one child)

8.false ( all the heap with child node at equal level are perfect tree)

9.False(heap with leaf node at same depth is perfect tree)

10.False(heap without a node having single child is complete tree)

11.false(a heap where all the node has two children then it is complete tree)

12.True

13.True

14.True (because heap is a binary tree with heap property)

15.False (then the sibling in left side must be having two child)

Add a comment
Know the answer?
Add Answer to:
6. T or F: There can be two or more nodes in a heap with exactly...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • 1. In a heap, the upper bound on the number of leaves is: (A) O(n) (B)...

    1. In a heap, the upper bound on the number of leaves is: (A) O(n) (B) O(1) (C) O(logn) (D) O(nlogn) 2. In a heap, the distance from the root to the furthest leaf is: (A) θ(nlogn) (B) θ(logn) (C) θ(1) (D) θ(n) 3. In a heap, let df be the distance of the furthest leaf from the root and let dc be the analogous distance of the closest leaf. What is df − dc, at most? (A) 1 (C)...

  • Problem 8. (Heap Top-k) Prof Dubious has made the following claim, and has provided a proof Claim. Let n and k be posit...

    Problem 8. (Heap Top-k) Prof Dubious has made the following claim, and has provided a proof Claim. Let n and k be positive integers such that 2*-1n. In amax-heap H of n elements, the top 21 elements are in the first k layers of the heap. Proof. Since is a max-heap, each node in H must satisfy the heap property, i.e., if H, is an element of H with at least one child then Hmaxchldren(H)). We know that every subtree...

  • In the lectures, we studied binary heaps. A min-Heap can be visualized as a binary tree...

    In the lectures, we studied binary heaps. A min-Heap can be visualized as a binary tree of height with each node having at most two children with the property that value of a node is at most the value of its children. Such heap containing n elements can be represented (stored) as an array with the property Suppose that you would like to construct a & min Heap: each node has at most& children and the value of a node...

  • A rooted binary tree T has 40 leaves. How many nodes in Thas exactly two children?...

    A rooted binary tree T has 40 leaves. How many nodes in Thas exactly two children? (The root is always assumed to have two children.)

  • Trees and Heaps 1. Show that the maximum number of nodes in a binary tree of...

    Trees and Heaps 1. Show that the maximum number of nodes in a binary tree of height h is 2h+1 − 1. 2. A full node is a node with two children. Prove that the number of full nodes plus one is equal to the number of leaves in a nonempty binary tree. 3. What is the minimum number of nodes in an AVL tree of height 15? 4. Show the result of inserting 14, 12, 18, 20, 27, 16,...

  • 1.(10 pts) Contrast a heap with a binary search tree by inserting the numbers 60, 30,...

    1.(10 pts) Contrast a heap with a binary search tree by inserting the numbers 60, 30, 40, 50, 20, 10 first in a BST and then in a min-heap. Draw the resulting BST on the left and the heap on the right. You may draw any valid BST or Heap that contain the provided values 2. (5 pts) In section 11.1, the book mentions that heaps are **complete** binary trees, what does that mean? Demonstrate by drawing an example of...

  • 1. A node that is a descendant of another node is called its a. root b....

    1. A node that is a descendant of another node is called its a. root b. sibling c. parent d. child 2. Any node in a tree that does not have any children is refered to as a a. leaf b. tail c. head d. root 3. A binary search tree is a binary tree with what property? a. An internal node is greater than all of its children b. An internal node is less than all of its children...

  • (true/false) All nodes in the right subtree of a node must be smaller in value than...

    (true/false) All nodes in the right subtree of a node must be smaller in value than their parent (true/false) Each node in a binary search tree may contain zero, one, or two children nodes. (true/false) It is possible to recursively process a binary search tree to print all the data in a binary search tree in sorted order. (true/false) The value of a parent must be less than all its children. (true/false) All nodes in the right subtree of a...

  • Let T be a binary tree with n nodes and let f() be the level numbering...

    Let T be a binary tree with n nodes and let f() be the level numbering function of the positions of T f suggests a epteseniatñion of a binary tree Tty in el marabering function f suggests a f an aray-ased wucture A. with the lt of the array We show an etample of an an el ermbering funcion f sugests a represeuani sl Wr show an example of an antay baed rerjesctanisa od a A with the clement an...

  • Answer the following question(s) concerning implementing recursive functions to perform operations on linked lists of nodes...

    Answer the following question(s) concerning implementing recursive functions to perform operations on linked lists of nodes arranged as binary trees. For these questions, use the following struct definition for the nodes of the tree (we will not templatize the node here, so you do not have to write template functions for these questions, just assume trees of <int> values): struct BinaryTreeNode { int item; BinaryTreeNode* left; BinaryTreeNode* right; }; ---------------------------------------------- Given a node for a Binary Tree and an (integer)...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT