MCQ IN COMPUTER SCIENCE & ENGINEERING

COMPUTER SCIENCE AND ENGINEERING

DATA STRUCTURES

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
The main difference between BST and Heap is
A
The top of the tree of the Heap must be the minimum element
B
The top of the tree of the Heap must be the maximum element
C
The top of the tree of the BST must be the minimum element
D
The top of the tree of the BST must be the minimum element
Explanation: 

Detailed explanation-1: -The Heap differs from a Binary Search Tree. The BST is an ordered data structure, however, the Heap is not. In computer memory, the heap is usually represented as an array of numbers. The heap can be either Min-Heap or Max-Heap.

Detailed explanation-2: -A BST is a binary tree based data structure that is viewed to support efficiently the dynamic set operations, including search and insert operations amongst others. A heap on the other hand is a specific tree based data structure in which all the nodes of tree are in a specific order.

Detailed explanation-3: -The key difference between a Binary Heap and a Binomial Heap is how the heaps are structured. In a Binary Heap, the heap is a single tree, which is a complete binary tree. In a Binomial Heap, the heap is a collection of smaller trees (that is, a forest of trees), each of which is a binomial tree.

Detailed explanation-4: -(CLRS 6.1-1) What are the minimum and maximum number of elements in a heap of height h? Solution: The minimum number of elements is 2h and the maximum number of elements is 2h+1 − 1.

Detailed explanation-5: -A max-heap is a complete binary tree in which the value in each internal node is greater than or equal to the values in the children of that node. A min-heap is defined similarly. The fact that a heap is a complete binary tree allows it to be efficiently represented using a simple array.

There is 1 question to complete.