+ 1
What is heap sort??
Real life application of heap sort Plz...... Explain it in easy wayđđ
2 Answers
+ 2
It's a sorting algorithm, that means you have a list of unsorted things and it comes out sorted.
It does so by turning the list into a heap, which is a binary tree (if you don't know what that is, look it up) with the added rule that each node in the tree must be smaller than it's parent.
So the data is being "half-sorted" by being turned into a heap, and heaps are capable of being sorted very quickly.
It has tons of real-life applications, because
- it is dang fast
- it is slower than quicksort, but more consistent (quicksort can be slow on certain inputs)
If you happen to already have a heap structure, heapsort of course always wins out.
+ 2
Thank you mr Schindlabua.... for explain heap sort