Skip to content

Instantly share code, notes, and snippets.

@0xekez
0xekez / radix.cpp
Last active May 9, 2019 07:02
c++-radix-sort
#include <climits> // CHAR_BIT
#include <iostream>
#include <random>
#include <vector>
#include <chrono>
void lsd_radix_sort(std::vector<int> &in) {
// get the size in bits of the ints
unsigned int width = sizeof(int)*CHAR_BIT;
// how much we'll shift over at each step