Skip to content

Commit cbd850b

Browse files
committed
Small corrections to QS background
1 parent 0db96cd commit cbd850b

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/algorithms/explanations/QSExp.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ Quicksort is a divide and conquer algorithm. It first rearranges the input
66
array into two smaller sub-arrays: the (relatively) low elements and the
77
(relatively) high elements. It then recursively sorts each of the sub-arrays.
88

9-
### Sorting using Basic Quicksort
9+
### Sorting using Quicksort
1010

11-
The steps for basic Quicksort, used in this animation are:
11+
The steps for Quicksort are:
1212

1313
* Pick the rightmost element of the array, called a pivot.
1414

@@ -23,11 +23,11 @@ The base case of the recursion is arrays of size one or zero, which are in order
2323

2424
Time complexity:
2525
<code>
26-
Average case <i>O(nlogn)</i>
26+
Average case <i>O(n log n)</i>
2727
Worst case <i>O(n<sup>2</sup>)</i>
28-
Best case <i>O(nlogn)</i>
28+
Best case <i>O(n log n)</i>
2929

30-
Note: Worst case in simple quicksort occurs when a file is already sorted, since the partition is highly asymmetrical. Improvements such as median-of-three quicksort make a significant improvement, although worst case behaviour is still possible.
30+
Note: Worst case in quicksort occurs when a file is already sorted, since the partition is highly asymmetrical. Improvements such as median-of-three quicksort make a significant improvement, although worst case behaviour is still possible.
3131
</code>
3232

3333
Space complexity is O(1), that is, no extra space is required.

0 commit comments

Comments
 (0)