I've been writing my linked list data structure from scratch as a student for projects/assignments and I was wondering in the "real-world" does a developer have to write their own linked list DS or use any of the already provided linked list object in the Java docs. Which is better & in what scenario?
A custom LinkedList implementation will very likely be more efficient because it allows you to make optimizations for your needs, however the JDK's LinkedList will always be preferable for its re-usability and maintainability benefits:
LinkedList.List interface will be automatically inherited.LinkedList will be compatible with many third-party libraries which use List.If you do decide to create a custom List implementation, you may choose to extend AbstractSequentialList in order to gain the benefits of #2, #4, and possibly #5.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With