Skip to content

Commit 68d7908

Browse files
authored
Merge pull request #61 from csvistool/bugsFix
fix quicksort/select pseudocode
2 parents 93fd768 + 20b7420 commit 68d7908

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

src/pseudocode.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1514,10 +1514,10 @@
15141514
[" swap array[left], array[pivotIdx]"],
15151515
[" i ← left + 1, j ← right - 1"],
15161516
[" while i <= j:"],
1517-
[" while", " ", "i <= j", " and ", "array[i] <= pivot", ":"],
1517+
[" while i <= j and array[i] <= pivot"],
15181518
[" i ← i + 1"],
15191519
[" end while"],
1520-
[" while", " ", "i <= j", " and ", "array[j] >= pivot", ":"],
1520+
[" while i <= j and array[j] >= pivot"],
15211521
[" j ← j - 1"],
15221522
[" end while"],
15231523
[" if i <= j:"],
@@ -1536,11 +1536,11 @@
15361536
[" pivot is the value at pivotIdx"],
15371537
[" swap array[left] with the pivot"],
15381538
[" i points to left + 1, j points to right - 1"],
1539-
[" while (j has not crossed i):"],
1540-
[" while", " (", "j has not crossed i", " and ", "array[i] <= pivot", "):"],
1539+
[" while j has not crossed i:"],
1540+
[" while j has not crossed i and array[i] <= pivot:"],
15411541
[" increment i"],
15421542
[" end while"],
1543-
[" while", " (", "j has not crossed i", " and ", "array[j] >= pivot", "):"],
1543+
[" while j has not crossed i and array[j] >= pivot:"],
15441544
[" decrement j"],
15451545
[" end while"],
15461546
[" if j and i have not crossed:"],
@@ -1564,10 +1564,10 @@
15641564
[" swap array[left], array[pivotIdx]"],
15651565
[" i ← left + 1, j ← right"],
15661566
[" while i <= j:"],
1567-
[" while", " ", "i <= j", " and ", "array[i] <= pivot", ":"],
1567+
[" while i <= j and array[i] <= pivot:"],
15681568
[" i ← i + 1"],
15691569
[" end while"],
1570-
[" while", " ", "i <= j", " and ", "array[j] >= pivot", ":"],
1570+
[" while j has not crossed i and array[j] >= pivot:"],
15711571
[" j ← j - 1"],
15721572
[" end while"],
15731573
[" if i <= j:"],
@@ -1592,10 +1592,10 @@
15921592
[" swap array[left] with the pivot"],
15931593
[" i points to left + 1, j points to right"],
15941594
[" while (j has not crossed i):"],
1595-
[" while", " (", "j has not crossed i", " and ", "array[i] <= pivot", "):"],
1595+
[" while j has not crossed i and array[i] <= pivot:"],
15961596
[" increment i"],
15971597
[" end while"],
1598-
[" while", " (", "j has not crossed i", " and ", "array[j] >= pivot", "):"],
1598+
[" while j has not crossed i and array[j] >= pivot:"],
15991599
[" decrement j"],
16001600
[" end while"],
16011601
[" if j and i have not crossed:"],

0 commit comments

Comments
 (0)