DATA STRUCTURE
Programming and Technical
Programming
Technical
if all the given elements in a array is same then what is the time complexity of the Heap Sort.
Read Solution (Total 10)
-
- heap sort complexity do not depend upon the type of input in array.
Thus its complexity remains O(nlgn) - 10 years agoHelpfull: Yes(11) No(0)
- For heap sort we have to construct heap first.And heap construction itself will take O(n logn)even if elements are same because its (Max Heap/ Min Heap)defination states greater or equal and less than or equal respectively. Hence in sorting deletion and swapping occur which take O(n logn ).
Thus ans will remain O(n logn). - 10 years agoHelpfull: Yes(4) No(0)
- ans:O(nlogn)
best , worst, avg case=O(nlogn) - 10 years agoHelpfull: Yes(1) No(1)
- time complexity of heap sort is o(nlogn)
- 10 years agoHelpfull: Yes(1) No(0)
- ans please
- 10 years agoHelpfull: Yes(0) No(0)
- heap sort complexity will be the same whatever the elements in the array is
o(nlog(n)) - 10 years agoHelpfull: Yes(0) No(0)
- When all the elements in a array is identical heap sort takes O(n) steps
- 10 years agoHelpfull: Yes(0) No(0)
- its time complexict is nlogn
- 10 years agoHelpfull: Yes(0) No(0)
- time complexity is O(n logn)
- 10 years agoHelpfull: Yes(0) No(0)
- T.C of heap sort-O(nlogn)
- 9 years agoHelpfull: Yes(0) No(1)
DATA STRUCTURE Other Question