To protect your data, the CISO officer has suggested users to enable 2FA as soon as possible.
Currently 2.7% of users enabled 2FA.

quicksort.c 681 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include <stdint.h>

void swap(int64_t* arr, int64_t i, int64_t j) {
    int64_t t;
    t = arr[i];
    arr[i] = arr[j];
    arr[j] = t;
}

int64_t partition(int64_t* arr, int64_t idx_low, int64_t idx_high) {
    int64_t pivot, i, j;
    pivot = arr[idx_high];
    i = idx_low;
    for (j = idx_low; j < idx_high; j ++) {
        if (arr[j] < pivot) {
            swap(arr, i, j);
            i += 1;
        }
    }
    swap(arr, i, idx_high);
    return i;
}

void quicksort(int64_t* arr, int64_t start, int64_t end) {
    int64_t p;
    if (start < end) {
        p = partition(arr, start, end);
        quicksort(arr, start, p - 1);
        quicksort(arr, p + 1, end);
    }
}