Skip to content

Commit bdedbff

Browse files
committed
Fix a typo in Selection Sort article
1 parent b49331f commit bdedbff

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Selection Sort/README.markdown

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ It works as follows:
1919
- Find the lowest number in the rest of the array, starting from index 2, and swap it with the one at index 2. Now, the array is sorted from index 0 to 2; this range contains the three lowest numbers in the array.
2020
- And continue until no numbers remain to be sorted.
2121

22-
It nis called a "selection" sort because at every step you search through the rest of the array to select the next lowest number.
22+
It is called a "selection" sort because at every step you search through the rest of the array to select the next lowest number.
2323

2424
## An example
2525

@@ -108,7 +108,7 @@ The source file [SelectionSort.swift](SelectionSort.swift) has a version of this
108108

109109
## Performance
110110

111-
The selection sort is easy to understand but it performs slow as **O(n^2)**. It is worse than [insertion sort](../Insertion%20Sort/) but better than [bubble sort](../Bubble%20Sort/). Finding the lowest element in the rest of the array is slow, especially since the inner loop will be performed repeatedly .
111+
The selection sort is easy to understand but it performs slow as **O(n^2)**. It is worse than [insertion sort](../Insertion%20Sort/) but better than [bubble sort](../Bubble%20Sort/). Finding the lowest element in the rest of the array is slow, especially since the inner loop will be performed repeatedly.
112112

113113
The [Heap sort](../Heap%20Sort/) uses the same principle as selection sort but has a fast method for finding the minimum value in the rest of the array. The heap sort' performance is **O(n log n)**.
114114

0 commit comments

Comments
 (0)