91 views
2 votes
2 votes

Which of the following is guaranteed to be a complete binary tree? (Mark all the appropriate choices)

  1. A tree with every node having exactly zero or two children
  2. A binary tree, which is completely filled, with the possible exception of the bottom level, which is filled from right to left
  3. A binary tree, which is completely filled, with the possible exception of the bottom level, which is filled from left to right
  4. A binary heap

1 Answer

2 votes
2 votes

A binary tree, which is completely filled, with the possible exception of the bottom level, which is filled from left to right is called complete binary tree. A Tree in which each node has exactly zero or two children is called full binary tree. A Tree in which the degree of each node is $2$ except leaf nodes is called perfect binary tree.

A Binary Heap is a Binary Tree with following properties.

  • It’s a complete tree (All levels are completely filled except possibly the last level and the last level has all keys as left as possible). This property of Binary Heap makes them suitable to be stored in an array.
  • A Binary Heap is either Min Heap or Max Heap. In a Min Binary Heap, the key at root must be minimum among all keys present in Binary Heap. The same property must be recursively true for all nodes in Binary Tree. Max Binary Heap is similar to MinHeap.

So, the correct answer is $(C,D).$

References:

Answer:

Related questions

2 votes
2 votes
1 answer
2
gatecse asked Aug 30, 2020
218 views
The number of distinct binary search trees of maximum height $3$ (counted from $0)$ possible with $5$ elements is _______
2 votes
2 votes
1 answer
3
gatecse asked Aug 30, 2020
194 views
The number of distinct binary trees possible with $6$ elements with just one element being repeated is ______