What is the time complexity of Huffman Coding ?

2025

What is the time complexity of Huffman Coding ?

Answer: B. O(N logN)Huffman Coding builds a binary tree using a min-heap. Each of the N characters requires O(logN) heap operations, resulting in total time complexity of O(N…

  1. A.

    O(N)

  2. B.

    O(N logN)

  3. C.

    O(N (logN)^2)

  4. D.

    O(N^2)

Attempted by 464 students.

Show answer & explanation

Correct answer: B

Huffman Coding builds a binary tree using a min-heap. Each of the N characters requires O(logN) heap operations, resulting in total time complexity of O(N logN).

Explore the full course: Tpsc Assistant Technical Officer

Loading lesson…