MB-Hacktoberfest2021 icon indicating copy to clipboard operation
MB-Hacktoberfest2021 copied to clipboard

Priority Queue Example in java

Open Hrit20 opened this issue 3 years ago • 0 comments

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

Hrit20 avatar Oct 05 '21 19:10 Hrit20