llvm-project/libcxx
David Majnemer 8b51260274 Fix std::make_heap's worst case time complexity
std::make_heap is currently implemented by iteratively applying a
siftup-type algorithm.  Since sift-up is O(ln n), this gives
std::make_heap a worst case time complexity of O(n ln n).

The C++ standard mandates that std::make_heap make no more than O(3n)
comparisons, this makes our std::make_heap out of spec.

Fix this by introducing an implementation of __sift_down and switch
std::make_heap to create the heap using it.
This gives std::make_heap linear time complexity in the worst case.

This fixes PR20161.

llvm-svn: 213615
2014-07-22 06:07:09 +00:00
..
cmake build: remove unnecessary modification of CMAKE_REQUIRED_DEFINITIONS 2014-03-12 04:11:34 +00:00
include Fix std::make_heap's worst case time complexity 2014-07-22 06:07:09 +00:00
lib eliminate install of duplicate headers (take 2) 2014-06-24 20:32:11 +00:00
src Add support for BIONIC C library (Android). Patch from Dan Albert 2014-07-10 15:20:28 +00:00
test Fix std::make_heap's worst case time complexity 2014-07-22 06:07:09 +00:00
www [libcxx] Add <experimental/utility> header for LFTS. 2014-07-17 05:31:31 +00:00
.arcconfig Update Arcanist config to point to reviews.llvm.org 2014-06-10 18:29:36 +00:00
CMakeLists.txt eliminate install of duplicate headers (take 2) 2014-06-24 20:32:11 +00:00
CREDITS.TXT Updated my role 2013-09-28 01:25:55 +00:00
LICENSE.TXT Update the copyright credits -- Happy new year 2014! 2014-01-01 08:27:31 +00:00
Makefile Exclude .svn (and other "dot" directories) when installing headers. 2014-03-13 16:13:54 +00:00