From 20b742075e0c6a0fedd8c09b8dc12089b4527906 Mon Sep 17 00:00:00 2001 From: Kathy Tran <113992934+kathy-tran07@users.noreply.github.com> Date: Wed, 29 Oct 2025 23:22:06 -0400 Subject: [PATCH] fix quicksort/select pseudocode --- src/pseudocode.json | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/pseudocode.json b/src/pseudocode.json index 68a53e5..d462053 100644 --- a/src/pseudocode.json +++ b/src/pseudocode.json @@ -1514,10 +1514,10 @@ [" swap array[left], array[pivotIdx]"], [" i ← left + 1, j ← right - 1"], [" while i <= j:"], - [" while", " ", "i <= j", " and ", "array[i] <= pivot", ":"], + [" while i <= j and array[i] <= pivot"], [" i ← i + 1"], [" end while"], - [" while", " ", "i <= j", " and ", "array[j] >= pivot", ":"], + [" while i <= j and array[j] >= pivot"], [" j ← j - 1"], [" end while"], [" if i <= j:"], @@ -1536,11 +1536,11 @@ [" pivot is the value at pivotIdx"], [" swap array[left] with the pivot"], [" i points to left + 1, j points to right - 1"], - [" while (j has not crossed i):"], - [" while", " (", "j has not crossed i", " and ", "array[i] <= pivot", "):"], + [" while j has not crossed i:"], + [" while j has not crossed i and array[i] <= pivot:"], [" increment i"], [" end while"], - [" while", " (", "j has not crossed i", " and ", "array[j] >= pivot", "):"], + [" while j has not crossed i and array[j] >= pivot:"], [" decrement j"], [" end while"], [" if j and i have not crossed:"], @@ -1564,10 +1564,10 @@ [" swap array[left], array[pivotIdx]"], [" i ← left + 1, j ← right"], [" while i <= j:"], - [" while", " ", "i <= j", " and ", "array[i] <= pivot", ":"], + [" while i <= j and array[i] <= pivot:"], [" i ← i + 1"], [" end while"], - [" while", " ", "i <= j", " and ", "array[j] >= pivot", ":"], + [" while j has not crossed i and array[j] >= pivot:"], [" j ← j - 1"], [" end while"], [" if i <= j:"], @@ -1592,10 +1592,10 @@ [" swap array[left] with the pivot"], [" i points to left + 1, j points to right"], [" while (j has not crossed i):"], - [" while", " (", "j has not crossed i", " and ", "array[i] <= pivot", "):"], + [" while j has not crossed i and array[i] <= pivot:"], [" increment i"], [" end while"], - [" while", " (", "j has not crossed i", " and ", "array[j] >= pivot", "):"], + [" while j has not crossed i and array[j] >= pivot:"], [" decrement j"], [" end while"], [" if j and i have not crossed:"],