0

Could someone help me with a linked list code.

I just cant figure it out.

I dont know how to code the part where I need to insert an element in ascending order.

Either when there are no nodes then when there is one or a few nodes.

Can anyone give a little nudge in the right direction?

3
Contributors
2
Replies
4
Views
12 Years
Discussion Span
Last Post by Tight_Coder_Ex
0

Could someone help me with a linked list code.

I just cant figure it out.

I dont know how to code the part where I need to insert an element in ascending order.

Either when there are no nodes then when there is one or a few nodes.

Can anyone give a little nudge in the right direction?

I used to read minds and peruse your computer for entertainment, but I've since lost this ability. Would you mind posting any code that you are wondering about?

0

Linked lists are very simple. Take for example a doubly linked list, it has a pointer to the previous item and one to the next. I use -1 or 0xffffffff to indicate the item is either at the begining or end of the list. Each time you insert a new element you just change the pointers so they keep the list ordered.

As Dave Sinkula has eluded too, post some code so whomever helps you has some idea where to start. Google "linked lists" and I'm sure you'll get lots of detailed information on how a list works, not necessarily associated code but there may be some breif examples.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.