My initial approach to implement this method would be to replace the desired element with the last element of the heap and then heapify like you would for removing the root,however this wouldn’t be correct as the last element may not be a child node of the element that is to be removed and the heap structure will be broken.
So how do I go about making sure I am maintaining the heap structure?