min heap stl

include

include

int main() { std::priority_queue, std::greater\> minHeap;

minHeap.push(3); // Insert 3 into the min heap minHeap.push(5); // Insert 5 into the min heap minHeap.push(1); // Insert 1 into the min heap

std::cout << minHeap.top() << std::endl; // Print the top element of the min heap (smallest element)

minHeap.pop(); // Remove the top element (smallest element) from the min heap

std::cout << minHeap.top() << std::endl; // Print the new smallest element of the min heap

return 0; }