Heapify in logarithmic time using the C++ standard library
问题 I have a heap using std::make_heap : std::vector<int> v{1,2,3,5,9,20,3}; std::make_heap(v.begin(), v.end()); now I update the heap by changing one random element: v[3] = 35; Is there a way in standard library in to adjust heap again in O(log n) time where n is size of container. Basically I am looking for heapify function. I know what element has been changed. I understand that std::make_heap is O(n log n) time. I have also gone through duplicate question but that is different in sense that