PadhaikoAll subjects

Past exam question: 2066 Jestha (Back), Q10(a)

Data Structure and Algorithms · 4 marks

Open in the Padhaiko app

Topic: Definition and tree terminologies · Binary trees · Binary search tree

Question

Write short notes on: a) Almost Complete Binary Tree

Solution

Almost Complete Binary Tree: An almost complete binary tree (also called a complete binary tree in heap literature) of height satisfies two rules:

  1. Every level from to is completely filled with nodes ( nodes at level ).
  2. On the deepest level , all existing leaf nodes are packed consecutively to the left without any gaps.
Answer:

An almost complete binary tree has all levels completely full and level filled strictly from left to right, enabling gap-free array storage for binary heaps.

All past exam questions for Data Structure and Algorithms