Skip to content

Commit

Permalink
Merge pull request kodecocodes#914 from satbot/heapsort-typo
Browse files Browse the repository at this point in the history
Fix typo in Heap Sort README lg -> log
  • Loading branch information
kelvinlauKL authored Feb 14, 2020
2 parents 6ac4728 + 43181f5 commit c22182f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Heap Sort/README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ As you can see, the largest items are making their way to the back. We repeat th

> **Note:** This process is very similar to [selection sort](../Selection%20Sort/), which repeatedly looks for the minimum item in the remainder of the array. Extracting the minimum or maximum value is what heaps are good at.
Performance of heap sort is **O(n lg n)** in best, worst, and average case. Because we modify the array directly, heap sort can be performed in-place. But it is not a stable sort: the relative order of identical elements is not preserved.
Performance of heap sort is **O(n log n)** in best, worst, and average case. Because we modify the array directly, heap sort can be performed in-place. But it is not a stable sort: the relative order of identical elements is not preserved.

Here's how you can implement heap sort in Swift:

Expand Down

0 comments on commit c22182f

Please sign in to comment.