All mock tests are FREE till 31 December — register to save your progress
Unit 7 · Data Structures and Algorithms Paper 2 CS · December 2022 Shift 1

Given six weights 4, 15, 25, 5, 8, 16, construct a 2-tree (extended binary tree) with minimum weighted path length. What is the minimum weighted path length?

Pick an option to check yourself, or open the answer below.

Show answer & explanation

Correct answer: B. 172

Explanation

Huffman merges: 4+5 = 9, 8+9 = 17, 15+16 = 31, 17+25 = 42, 31+42 = 73. Weighted path length = sum of internal nodes = 9 + 17 + 31 + 42 + 73 = 172.

More Data Structures and Algorithms questions