LinkedList

Hello allCan anyone please give me a nice explanation of how LinkedLlists work? How to declare nodes?How to add a node?How to delete a node? Thanks!!! :-D
[196 byte] By [River_Platea] at [2007-11-27 9:21:27]
# 1

In computer science, a linked list is one of the fundamental data structures used in computer programming. It consists of a sequence of nodes, each containing arbitrary data fields and one or two references ("links") pointing to the next and/or previous nodes. The principal benefit ...

Read more:

http://en.wikipedia.org/wiki/Linked_list

prometheuzza at 2007-7-12 22:15:19 > top of Java-index,Java Essentials,New To Java...
# 2

Yes i've read that article and even the API's to get an idea of what it is.

Right now my problem is on how to implement a linked list that adds elements and how to erase any given element. I've been having a hard time trying to create a list and adding nodes to it. :-/

for example how do i insert a node between 2 nodes?

Thanks!

River_Platea at 2007-7-12 22:15:19 > top of Java-index,Java Essentials,New To Java...
# 3
the wikipedia article tells you how to do all this.
petes1234a at 2007-7-12 22:15:19 > top of Java-index,Java Essentials,New To Java...
# 4

> Yes i've read that article and even the API's to get

> an idea of what it is.

>

> Right now my problem is on how to implement a linked

> list that adds elements and how to erase any given

> element. I've been having a hard time trying to

> create a list and adding nodes to it. :-/

>

> for example how do i insert a node between 2 nodes?

>

> Thanks!

Ok, what do you have so far then? Can you add nodes to your list? Can you print the values from your list?

Please post your code, and explain where you're stuck. Don't forget the code-tags!

prometheuzza at 2007-7-12 22:15:19 > top of Java-index,Java Essentials,New To Java...