priority queue smallest first

#include <iostream>
#include <queue>

int main() {
    // Step 1: Define a priority queue of integers with smallest element first
    std::priority_queue<int, std::vector<int>, std::greater<int>> minHeap;

    // Step 2: Insert elements into the priority queue
    minHeap.push(5);
    minHeap.push(3);
    minHeap.push(7);
    minHeap.push(1);
    minHeap.push(9);

    // Step 3: Access the smallest element at the top of the priority queue
    int smallestElement = minHeap.top();

    // Step 4: Remove the smallest element from the priority queue
    minHeap.pop();

    // Step 5: Print the remaining elements in the priority queue
    while (!minHeap.empty()) {
        std::cout << minHeap.top() << " ";
        minHeap.pop();
    }

    return 0;
}