From 1862c044b7e012ea0a058eb99b2e71e56e946d0b Mon Sep 17 00:00:00 2001 From: lty96117 Date: Thu, 21 Dec 2017 23:54:05 +0800 Subject: [PATCH] fixed a typo in quickSort --- 6.quickSort.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/6.quickSort.md b/6.quickSort.md index 1c81c59..d08b28f 100644 --- a/6.quickSort.md +++ b/6.quickSort.md @@ -62,7 +62,7 @@ function swap(arr, i, j) { arr[i] = arr[j]; arr[j] = temp; } -functiion paritition2(arr, low, high) { +function partition2(arr, low, high) { let pivot = arr[low]; while (low < high) { while (low < high && arr[high] > pivot) { @@ -80,7 +80,7 @@ functiion paritition2(arr, low, high) { function quickSort2(arr, low, high) { if (low < high) { - let pivot = paritition2(arr, low, high); + let pivot = partition2(arr, low, high); quickSort2(arr, low, pivot - 1); quickSort2(arr, pivot + 1, high); }