|
ADS
Algorithms and Data Structures
|
The sort of a file larger than the memory, beyond the book, as Knuth describes it for tapes, here on sequences in memory that play the files: More...
#include "ADS/Contract.h"#include "ADS/priority/DaryHeap.h"#include "ADS/sort/Sorted.h"#include <algorithm>#include <cstddef>#include <deque>#include <functional>#include <utility>#include <vector>#include "ADS/sort/impl/ExternalSort.tpp"Go to the source code of this file.
Namespaces | |
| namespace | ADS |
Functions | |
| template<class T, class C = std::less<>> | |
| std::vector< std::vector< T > > | ADS::replacementSelection (const std::vector< T > &input, std::size_t M, C less=C()) |
| the runs of the input made by replacement selection with \( M \) items in memory | |
| template<class T, class C = std::less<>> | |
| std::vector< T > | ADS::polyphaseMerge (std::vector< std::vector< T > > runs, std::size_t tapes, C less=C(), std::size_t *phases=nullptr) |
| the polyphase merge of the runs on \( T \) tapes; the phases go to *phases, if given | |
| template<class T, class C = std::less<>> | |
| std::vector< T > | ADS::externalSort (const std::vector< T > &input, std::size_t M, std::size_t tapes, C less=C()) |
| the sort of input by replacementSelection() and then polyphaseMerge() | |
The sort of a file larger than the memory, beyond the book, as Knuth describes it for tapes, here on sequences in memory that play the files:
The contracts [see Contract.h]: \( M \ge 1 \) and \( T \ge 3 \); the runs are sorted and hold the items of the input, and the merge gives the items of the runs sorted, two audits. The functions are defined in ExternalSort.tpp.