mirror of
https://gitlab.com/magicalsoup/Highschool.git
synced 2025-01-23 16:11:46 -05:00
Update Insertion Sort.md
This commit is contained in:
parent
bee1e0a88b
commit
51716bd088
@ -66,7 +66,7 @@ Number of passes and comparisons
|
|||||||
- Insetion sort always require n-1 passes
|
- Insetion sort always require n-1 passes
|
||||||
- Mininimum number of comparisons = $`n-1`$
|
- Mininimum number of comparisons = $`n-1`$
|
||||||
- maximum number of comparisons = $`\dfrac{n^2-n}{2}`$ or $`n(n-1)/2`$
|
- maximum number of comparisons = $`\dfrac{n^2-n}{2}`$ or $`n(n-1)/2`$
|
||||||
- Average number of comparisons = $`\dfrac{n^2-n}{4}`$ or $n(n-1)/4`$
|
- Average number of comparisons = $`\dfrac{n^2-n}{4}`$ or $`n(n-1)/4`$
|
||||||
|
|
||||||
## When To Use
|
## When To Use
|
||||||
- Good to use when the array is `nearly sorted`, and only a few elements are misplaced
|
- Good to use when the array is `nearly sorted`, and only a few elements are misplaced
|
||||||
|
Loading…
Reference in New Issue
Block a user