how to implement linkedlists without using util package in java?

Recommended Answers

All 3 Replies

You can simply add references to next and previous (if you want doubly-linked list) instances in your class if you want to. A linked list just keeps track of the instances it is connected to, so you can handle this on your own easily. You will also need to write the methods for searching, adding, and removing instances from the list if you require that functionality.

Member Avatar for iamthwee

Read a tutorial, do it, then ask a question.

or read your courseware. It will contain descriptions of data structures, which should be enough to allow you to implement them (as the only reason to ever do this in Java is for a course in data structures).

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.