A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://TheAlgorithms.github.io/C-Plus-Plus/d8/d7c/radix__sort_8cpp_source.html below:

TheAlgorithms/C++: sorting/radix_sort.cpp Source File

6void

radixsort(

int

a[],

int

n) {

8 int

* output =

new int

[n];

9

memset(output, 0, n *

sizeof

(*output));

10

memset(count, 0,

sizeof

(count));

12 for

(

int

i = 0; i < n; ++i) {

22 for

(

int

j = 0; j < maxdigits; j++) {

23 for

(

int

i = 0; i < n; i++) {

24 int

t = std::pow(10, j);

25

count[(a[i] % (10 * t)) / t]++;

28 for

(

int

p = 0; p < 10; p++) {

29 for

(

int

i = 0; i < n; i++) {

30 int

t = std::pow(10, j);

31 if

((a[i] % (10 * t)) / t == p) {

37

memset(count, 0,

sizeof

(count));

38 for

(

int

i = 0; i < n; ++i) {

45void

print(

int

a[],

int

n) {

46 for

(

int

i = 0; i < n; ++i) {

47

std::cout << a[i] <<

" "

;

49

std::cout << std::endl;

53 int

a[] = {170, 45, 75, 90, 802, 24, 2, 66};

54 int

n =

sizeof

(a) /

sizeof

(a[0]);

double k(double x)

Another test function.

int main()

Main function.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4