Discuss Forum

1. what is the time complexity of Huffman Coding?

  • A. O (N)
  • B. O (N)
  • C. O (N)
  • D. O (N)

Answer: Option B

Explanation:

The time complexity of the Huffman algorithm is O(nlogn). Using a heap to store the weight of each tree, each iteration requires O(logn) time to determine the cheapest weight and insert the new weight. There are O(n) iterations, one for each item.

Post your comments here:

Name:
Mobile:
Email:(Optional)

» Your comments will be displayed only after manual approval.