The correct sequence of constructing Huffman tree is
A. Repeat until root formed
B. Create leaf nodes
C. Build priority queue
D. Combine lowest frequency nodes
Choose the correct answer from the options given below:
🎥 Video solution / Text Solution of this question is given below:
Create leaf nodes (B) for each character with their frequency.
Build a priority queue (C) (min-heap) based on frequency.
Combine lowest frequency nodes (D) repeatedly to form new internal nodes.
Repeat until root formed (A) — the final remaining node is the root of the Huffman tree.
Hence, the correct order is B → C → D → A.