|
1514 | 1514 | [" swap array[left], array[pivotIdx]"], |
1515 | 1515 | [" i ← left + 1, j ← right - 1"], |
1516 | 1516 | [" while i <= j:"], |
1517 | | - [" while", " ", "i <= j", " and ", "array[i] <= pivot", ":"], |
| 1517 | + [" while i <= j and array[i] <= pivot"], |
1518 | 1518 | [" i ← i + 1"], |
1519 | 1519 | [" end while"], |
1520 | | - [" while", " ", "i <= j", " and ", "array[j] >= pivot", ":"], |
| 1520 | + [" while i <= j and array[j] >= pivot"], |
1521 | 1521 | [" j ← j - 1"], |
1522 | 1522 | [" end while"], |
1523 | 1523 | [" if i <= j:"], |
|
1536 | 1536 | [" pivot is the value at pivotIdx"], |
1537 | 1537 | [" swap array[left] with the pivot"], |
1538 | 1538 | [" 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:"], |
1541 | 1541 | [" increment i"], |
1542 | 1542 | [" end while"], |
1543 | | - [" while", " (", "j has not crossed i", " and ", "array[j] >= pivot", "):"], |
| 1543 | + [" while j has not crossed i and array[j] >= pivot:"], |
1544 | 1544 | [" decrement j"], |
1545 | 1545 | [" end while"], |
1546 | 1546 | [" if j and i have not crossed:"], |
|
1564 | 1564 | [" swap array[left], array[pivotIdx]"], |
1565 | 1565 | [" i ← left + 1, j ← right"], |
1566 | 1566 | [" while i <= j:"], |
1567 | | - [" while", " ", "i <= j", " and ", "array[i] <= pivot", ":"], |
| 1567 | + [" while i <= j and array[i] <= pivot:"], |
1568 | 1568 | [" i ← i + 1"], |
1569 | 1569 | [" end while"], |
1570 | | - [" while", " ", "i <= j", " and ", "array[j] >= pivot", ":"], |
| 1570 | + [" while j has not crossed i and array[j] >= pivot:"], |
1571 | 1571 | [" j ← j - 1"], |
1572 | 1572 | [" end while"], |
1573 | 1573 | [" if i <= j:"], |
|
1592 | 1592 | [" swap array[left] with the pivot"], |
1593 | 1593 | [" i points to left + 1, j points to right"], |
1594 | 1594 | [" 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:"], |
1596 | 1596 | [" increment i"], |
1597 | 1597 | [" end while"], |
1598 | | - [" while", " (", "j has not crossed i", " and ", "array[j] >= pivot", "):"], |
| 1598 | + [" while j has not crossed i and array[j] >= pivot:"], |
1599 | 1599 | [" decrement j"], |
1600 | 1600 | [" end while"], |
1601 | 1601 | [" if j and i have not crossed:"], |
|
0 commit comments