I replaced one random element of heap and then called push_heap on this container. What complexity does it have in this case: O(n) or O(logN)?
/* heap elements are stored on a random-access container */
std::vector<int> Q = { 3, 4, 2, 1 };
/* heapify Q (linear run-time complexity) */
std::make_heap(Q.begin(), Q.end());
std::cout << std::is_heap(Q.begin(), Q.end()) << std::endl;
std::cout << Q[3] << std::endl;
Q[3] = 5;
std::push_heap(Q.begin(), Q.end());
std::cout << std::is_heap(Q.begin(), Q.end()) << std::endl;