Skip to content

Commit 6ad75fe

Browse files
committed
small changes to doc
1 parent ade9c4b commit 6ad75fe

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

sorting/insertion_sort/README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Insertion sort is a simple sorting algorithm that builds the final sorted array
77
## Complexity
88

99
Worst Case Time Complexity [ Big-O ]: **O(n2)**
10-
Best Case Time Complexity [Big-omega]: **O(n)**
10+
Best Case Time Complexity [Big-omega]: **O(n)**
1111
Average Time Complexity [Big-theta]: **O(n2)**
1212
Space Complexity: **O(n)**
1313

@@ -23,15 +23,15 @@ Sorting is typically done in-place, by iterating up the array, growing the sorte
2323

2424
> **12**, 11, 13, 5, 6
2525
>
26-
> Let us loop for i = 1 (second element of the array) to 4 (last element of the array)
27-
> i = 1. Since 11 is smaller than 12, move 12 and insert 11 before 12
26+
> Let us loop for i = 1 (second element of the array) to 4 (last element of the array)
27+
> i = 1. Since 11 is smaller than 12, move 12 and insert 11 before 12
2828
> **11**, 12, 13, 5, 6
2929
>
30-
> i = 2. 13 will remain at its position as all elements in A[0..I-1] are smaller than 13
30+
> i = 2. 13 will remain at its position as all elements in A[0..I-1] are smaller than 13
3131
> **11, 12, 13**, 5, 6
3232
>
33-
> i = 3. 5 will move to the beginning and all other elements from 11 to 13 will move one position ahead of their current position.
33+
> i = 3. 5 will move to the beginning and all other elements from 11 to 13 will move one position ahead of their current position.
3434
> **5, 11, 12, 13**, 6
3535
>
36-
> i = 4. 6 will move to position after 5, and elements from 11 to 13 will move one position ahead of their current position.
36+
> i = 4. 6 will move to position after 5, and elements from 11 to 13 will move one position ahead of their current position.
3737
> **5, 6, 11, 12, 13**

0 commit comments

Comments
 (0)