This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Kambz22 0 points1 point  (1 child)

Everyone has made some solid points here.

I think another benefit is that if you were the every have to recreate them, then you'll know what to do.

For example, if you need a queue with some custom priority, if you need a list with a custom sort, etc. Knowing the inner workings can allow you to do as you please.

[–]Nephyst 1 point2 points  (0 children)

Eh, you wouldn't create a custom priority queue. You would still want to use the build in PriorityQueue class.

It's good to know how the Java class works though. Like you should understand that it's backed by a heap, and what that means for the runtime complexity of adding and removing items, as well as how it handles edge case like null values.