Back to course home
0% completed
Vote For New Content
Simpler time complexity
Tobby Lie
Sep 23, 2024
Since the maximum number of characters in the alphabet is fixed and has an upper bound, can't we say that the time complexity is just O(nlog(1)) which simplifies to O(n)? Or at the very least, it would be O(nlog(k)) where k << n since at any given time, the heap can only store a max of k characters.
0
0
Comments
Comments
P
Pete Stengera year ago
Not really - as we reinsert the character back into the heap.