mirror of
https://github.com/RGBCube/serenity
synced 2025-05-14 04:54:58 +00:00
AK: Change quicksort comments to standard // style
This commit is contained in:
parent
22f472249d
commit
b81a457de5
1 changed files with 10 additions and 11 deletions
|
@ -12,17 +12,16 @@
|
||||||
|
|
||||||
namespace AK {
|
namespace AK {
|
||||||
|
|
||||||
/* This is a dual pivot quick sort. It is quite a bit faster than the single
|
// This is a dual pivot quick sort. It is quite a bit faster than the single
|
||||||
* pivot quick_sort below. The other quick_sort below should only be used when
|
// pivot quick_sort below. The other quick_sort below should only be used when
|
||||||
* you are stuck with simple iterators to a container and you don't have access
|
// you are stuck with simple iterators to a container and you don't have access
|
||||||
* to the container itself.
|
// to the container itself.
|
||||||
*
|
//
|
||||||
* We use a cutoff to insertion sort for partitions of size 7 or smaller.
|
// We use a cutoff to insertion sort for partitions of size 7 or smaller.
|
||||||
* The idea is to avoid recursion for small partitions.
|
// The idea is to avoid recursion for small partitions.
|
||||||
* The value 7 here is a magic number. According to princeton's CS algorithm class
|
// The value 7 here is a magic number. According to princeton's CS algorithm class
|
||||||
* a value between 5 and 15 should work well in most situations:
|
// a value between 5 and 15 should work well in most situations:
|
||||||
* https://algs4.cs.princeton.edu/23quicksort/
|
// https://algs4.cs.princeton.edu/23quicksort/
|
||||||
*/
|
|
||||||
|
|
||||||
static constexpr int INSERTION_SORT_CUTOFF = 7;
|
static constexpr int INSERTION_SORT_CUTOFF = 7;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue