V
viki
I have vector 'vec' of integers which was made into valid heap using
std::make_heap().
Then we change value of a single element vec[k], like: vec[k] =
new_value;
Now this makes vec not a valid heap.
Heaps have simple algorithm that restores "heap validity" in O(log
N)after one element was changed, knowing index of changed element.
But I cannot find this function in stl.
Which stl function restores my heap vaidity in O(log N) after single
element change, given known index k of changed element ?
Thanks
vikimun
std::make_heap().
Then we change value of a single element vec[k], like: vec[k] =
new_value;
Now this makes vec not a valid heap.
Heaps have simple algorithm that restores "heap validity" in O(log
N)after one element was changed, knowing index of changed element.
But I cannot find this function in stl.
Which stl function restores my heap vaidity in O(log N) after single
element change, given known index k of changed element ?
Thanks
vikimun