Homechevron_rightEngineeringchevron_rightComputer Sciencechevron_rightData Structurechevron_rightHeaps

Heaps MCQs

  • 1. In a Heap tree
  • filter_dramaExplanation
    Answer is : B
    None.
  • 2. In a min heap
  • filter_dramaExplanation
    Answer is : C
    None.
  • 3. In a Heap tree
  • filter_dramaExplanation
    Answer is : B
    None.
  • 4. Heap is an example of ................
  • filter_dramaExplanation
    Answer is : A
    None.
  • 5. The running time for creating a heap of size n is .............
  • filter_dramaExplanation
    Answer is : C
    None.
  • 6. In a min-heap:
  • filter_dramaExplanation
    Answer is : A
    None.
  • 7. If we implement heap as min-heap , deleting root node (value 1)from the heap. What would be the value of root node after second iteration if leaf node (value 100) is chosen to replace the root at start.

    data-structure-questions-answers-heap-q6
  • filter_dramaExplanation
    Answer is : A
    None.
  • 8. If we implement heap as maximum heap , adding a new node of value 15 to the left most node of right subtree . What value will be at leaf nodes of the right subtree of the heap.

    data-structure-questions-answers-heap-q7
  • filter_dramaExplanation
    Answer is : A
    None.
  • 9. Why is heap implemented using array representations than tree(linked list) representations though both tree representations and heaps have same complexities?

    for binary heap

    -insert: O(log n)

    -delete min: O(log n)

    for a tree

    -insert: O(log n)

    -delete: O(log n)

    Then why go with array representation when both are having same values ?
  • filter_dramaExplanation
    Answer is : D
    None.
  • 10. In a max-heap, element with the greatest key is always in the which node?
  • filter_dramaExplanation
    Answer is : C
    None.
leaderboardLeaderboard
  • Rahul Kumar

    191 Points

  • VIKRAM JEET

    54 Points

  • GEETHIKA CHOWDARY

    53 Points

  • sunita saini

    52 Points

  • Zain

    49 Points