8 views

1 Answers

An American flag sort is an efficient, in-place variant of radix sort that distributes items into buckets. Non-comparative sorting algorithms such as radix sort and American flag sort are typically used to sort large objects such as strings, for which comparison is not a unit-time operation.American flag sort iterates through the bits of the objects, considering several bits of each object at a time. For each set of bits, American flag sort makes two passes through the array of objects: first to count the number of objects that will fall in each bin, and second to place each object in its bucket. This works especially well when sorting a byte at a time, using 256 buckets. With some optimizations, it is twice as fast as quicksort for large sets of strings.

The name American flag sort comes by analogy with the Dutch national flag problem in the last step: efficiently partition the array into many "stripes".

8 views

Related Questions

What is Natural sort order?
1 Answers 4 Views
What is Flag of Lower Saxony?
1 Answers 4 Views
What is Flag of Kutaisi?
1 Answers 4 Views
What is Direction flag?
1 Answers 8 Views
What is Interrupt flag?
1 Answers 8 Views
What is Flag of Pichilemu?
1 Answers 5 Views
What is Strand sort?
1 Answers 6 Views
What is Stooge sort?
1 Answers 4 Views
What is Interpolation sort?
1 Answers 5 Views