From 51716bd08864420238c16cc469d45c0d5946b974 Mon Sep 17 00:00:00 2001 From: James Su Date: Wed, 6 Nov 2019 17:02:12 +0000 Subject: [PATCH] Update Insertion Sort.md --- .../Computer Science/ICS4U1/Sorting Methods/Insertion Sort.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Grade 10/Computer Science/ICS4U1/Sorting Methods/Insertion Sort.md b/Grade 10/Computer Science/ICS4U1/Sorting Methods/Insertion Sort.md index 2827d9e..6827c27 100644 --- a/Grade 10/Computer Science/ICS4U1/Sorting Methods/Insertion Sort.md +++ b/Grade 10/Computer Science/ICS4U1/Sorting Methods/Insertion Sort.md @@ -66,7 +66,7 @@ Number of passes and comparisons - Insetion sort always require n-1 passes - Mininimum number of comparisons = $`n-1`$ - 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 - Good to use when the array is `nearly sorted`, and only a few elements are misplaced