[libcxx-commits] [PATCH] D144538: Checked that complexity of std::sort_heap is 2N log(N) comparisons

Nikolas Klauser via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Sun Mar 5 13:40:55 PST 2023


philnik accepted this revision.
philnik added a comment.
This revision is now accepted and ready to land.

LGTM with comments addressed.



================
Comment at: libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/sort.heap/complexity.pass.cpp:63-66
+    // The exact stats of our current implementation are recorded here.
+    // If something changes to make them go a bit up or down, that's probably
+    // fine, and we can just update this test.
+    // But if they suddenly leap upward, that's a bad thing.
----------------
This comments seems to be wrong now. Same in the ranges test.


================
Comment at: libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/sort.heap/complexity.pass.cpp:75
+    LIBCPP_ASSERT(std::is_sorted(first, last));
+  }
   return 0;
----------------
Also for the ranges code.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D144538/new/

https://reviews.llvm.org/D144538



More information about the libcxx-commits mailing list