Skip to content

Commit

Permalink
test priority_queue in main.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
Lammmmmmm committed Mar 7, 2020
1 parent e2c6b3c commit 9e405db
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,14 @@ using std::endl;
using std::vector;

int main() {
// mystl::list_test();
mystl::vector<int> vec = {1, 2, 3, 4, 5};
mystl::priority_queue<int> pq(vec.begin(), vec.end());
cout << pq.empty() << endl; // 5
cout << pq.size() << endl; // 4
cout << pq.top() << endl; // 1
cout << pq.empty() << endl;
cout << pq.size() << endl;
cout << pq.top() << endl;
pq.push(6);
cout << pq.top() << endl; // 1
cout << pq.top() << endl;
pq.pop();
cout << pq.top() << endl; // 1
cout << pq.top() << endl;
return 0;
}

0 comments on commit 9e405db

Please sign in to comment.