Can you please expalin me what is the time complexity of huffman coding?
In this quiz the answer is given as O(N*(logN)^2) and in the previous quiz, the answer was O(N*logN)
Can you please expalin me what is the time complexity of huffman coding?
In this quiz the answer is given as O(N*(logN)^2) and in the previous quiz, the answer was O(N*logN)
O(nlogn) where n is the number of unique characters. If there are n nodes, extractMin() is called 2*(n – 1) times. extractMin() takes O(logn) time as it calles minHeapify(). So, overall complexity is O(nlogn).
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.
so why quiz is saying wrong answer when we choose O(nlogn)?