Skip to content

Instantly share code, notes, and snippets.

View devgioele's full-sized avatar

devgioele devgioele

View GitHub Profile
@devgioele
devgioele / HoareLomuto.java
Created December 14, 2020 11:39
Hoare and Lomuto Algorithms
int partitionLomuto(int[] A) {
int l = 0, r = A.length - 1;
int p = A[r];
int ll = l - 1;
for (int bu = l; bu < r; bu++) {
if (A[bu] <= p) {
ll++;
swap(A, ll, bu);
}