Java exercises and solutions: doubly linked list


Java OOP: doubly linked list

Exercise: create a doubly linked list in Java programming language by using Object-Oriented Programming(OOP) concept.

The doubly linkedlist is much similar to the singly linkedlist, except that in the doubly linked list, we add a previous link to the element of the list. By doing this the list can be traversed forward and backward.

doubly linked list in Java

In this solution to the exercise, we are going to build a doubly linkedlist that has two helpful links--one(pfirst) points to the first item of the list and another one(plast) point to the last item of the list. The program also provides a menu of choices that a user can use do some operations on the linkedlist.

doubly linkedlist operations menu in Java  

To keep the solution simple, we divide it in to different steps as you see their links on the right menu.




Comments

sasikumar comment

 sasikumar

java looops process problem solve pls


2017-11-15
rita comment

 rita

plz help me to write this code
e= 1+1/1!+1/2!+1/3!+1/4!+... +1/i!
and when e =0 the program will be stopped
thank you


2017-11-03
Daniel comment

 Daniel

design and implement an application that work as a stopwatch. Include a display tha shows the time (in second) as it increments. Include buttons that allow the user to start and stop the time, and reset the display to zero. Arrange the components to present a nice interface.


2016-12-05
Anonymous comment

 Anonymous

Please add search criteria for this site.


2016-08-03



This website intents to provide free and high quality tutorials, examples, exercises and solutions, questions and answers of programming and scripting languages:
C, C++, C#, Java, VB.NET, Python, VBA,PHP & Mysql, SQL, JSP, ASP.NET,HTML, CSS, JQuery, JavaScript and other applications such as MS Excel, MS Access, and MS Word. However, we don't guarantee all things of the web are accurate. If you find any error, please report it then we will take actions to correct it as soon as possible.