mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-22 09:21:57 -05: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 {
|
||||
|
||||
/* 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
|
||||
* you are stuck with simple iterators to a container and you don't have access
|
||||
* to the container itself.
|
||||
*
|
||||
* We use a cutoff to insertion sort for partitions of size 7 or smaller.
|
||||
* The idea is to avoid recursion for small partitions.
|
||||
* 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:
|
||||
* https://algs4.cs.princeton.edu/23quicksort/
|
||||
*/
|
||||
// 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
|
||||
// you are stuck with simple iterators to a container and you don't have access
|
||||
// to the container itself.
|
||||
//
|
||||
// We use a cutoff to insertion sort for partitions of size 7 or smaller.
|
||||
// The idea is to avoid recursion for small partitions.
|
||||
// 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:
|
||||
// https://algs4.cs.princeton.edu/23quicksort/
|
||||
|
||||
static constexpr int INSERTION_SORT_CUTOFF = 7;
|
||||
|
||||
|
|
Loading…
Reference in a new issue