MB-Hacktoberfest2021
MB-Hacktoberfest2021 copied to clipboard
Priority Queue Example in java
Have you read the Contributing Guidelines on Pull Requests?
(Write your answer here.) Yes
Description
(Write your answer here.) Let's see a PriorityQueue example where we are adding books to queue and printing all the books. The elements in PriorityQueue must be of Comparable type. String and Wrapper classes are Comparable by default. To add user-defined objects in PriorityQueue, you need to implement Comparable interface.
Checklist
- [.] I've read the contribution guidelines.
- [.] I've checked the issue list before deciding what to submit.
- [.] I've added only
source code file
.
Related Issues or Pull Requests
(Write your answer here.)
---No Issues
(To fasten your PR review process mention me (@ananddasani)) @ananddasani