Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to do link list in java?

 
max soyosa
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi to all!
can anyone help me or teach me on how to do linklist in java?

please help!
 
Vijitha Kumara
Bartender
Posts: 3913
9
Chrome Fedora Hibernate
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
max soyosa wrote:can anyone help me or teach me on how to do linklist in java?

Do you need an existing implementation for LinkedList (infact there's a one with the name itself) in Java or need to implement a one using Java?
And, please CarefullyChooseOneForum when posting. This forum is for questions specific to JDBC.
 
Devaka Cooray
ExamLab Creator
Marshal
Pie
Posts: 4318
234
Chrome Eclipse IDE Google App Engine IntelliJ IDE jQuery Postgres Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please tell more details on what you are finding for.
Moving to Beginning Java forum.
 
Campbell Ritchie
Sheriff
Posts: 48652
56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Start with a singly linked list. Each node has a link to the next node, and the last node keeps a null in that reference. You need recursive methods which look for the next node, and each node has a value of some sort attached as its reference.
 
Vineet Kakati
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
create a class Node having instance variables data and p;
the variable data stores data.
the variable p is of type Node which points to another node;

create a linked list by creating objects of class node and link them together by using variable p for each node;
p for last node should be null;
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic