MCPcopy Create free account
hub / github.com/chronoxor/CppBenchmark / ShellSortInternal

Method ShellSortInternal

examples/sort.cpp:231–243  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

229
230private:
231 void ShellSortInternal(std::vector<int>& subitems, size_t d) const
232 {
233 for (size_t i = d; i < subitems.size(); ++i)
234 {
235 // Take the next item
236 for (size_t j = i + 1; j >= d + 1; j -= d)
237 {
238 // Check the current item with the previous one
239 if (subitems[j - 1] < subitems[j - d - 1])
240 std::swap(subitems[j - 1], subitems[j - d - 1]);
241 }
242 }
243 }
244};
245
246class MergeSort : public CppBenchmark::Benchmark, public SortFixture

Callers

nothing calls this directly

Calls 1

swapFunction · 0.50

Tested by

no test coverage detected