aboutsummaryrefslogtreecommitdiffstats
path: root/src/lesson40_algo12.cpp
Commit message (Collapse)AuthorAgeFilesLines
* lesson40_*: Resolve midpoint sum overflow, mention std::midpointSven Göthel2024-05-061-1/+2
|
* Resolve clang-tidy warnings=error; Notable std::vector<>: size() -> size_t ↵Sven Göthel2024-05-031-3/+3
| | | | | | | | | | | (unsigned) but iterator and difference_type are signed and losing half of range Because std::vector<>::begin() iterator performs arithmetic using a signed difference_type, we need to use such a signed type here to avoid `bugprone-narrowing-conversions` (LINT) Now, isn't this odd as std::vector<>::size() uses unsigned size_type, aka size_t and mentioned iterator hence lose half the value range possible?
* lesson40_algo12: Cleanup: Use value-reference for pivot-points reducing ↵Sven Göthel2024-04-241-34/+37
| | | | lookup, rename 'array' -> 'A'
* lesson40_algo12: hoare2: Cleanup my own partitioning trialSven Göthel2024-04-241-38/+1
|
* lesson40_algo12: Hoare-Yaroslavskiy: Simplify end-partition 2-swaps by ↵Sven Göthel2024-04-241-17/+11
| | | | pre-swapping hi/lo pivot at start
* lesson40_algo12: Hoare-Yaroslavskiy: Use reference to pivots adding ↵Sven Göthel2024-04-241-5/+15
| | | | std::move for 2x 3-way swap at end of partitioning
* lesson40_algo12: Merge partition into qsort; Add Hoare-Yaroslavskiy ↵Sven Göthel2024-04-231-102/+141
| | | | dual-pivot quicksort variant (claimed >= 10% faster)
* Adding lesson 40: binary-search *01.cpp, +sorted_insert *02 and quicksort ↵Sven Göthel2024-04-231-0/+405
*12.cpp, each with optional variations