954,498 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

how to create linked list?

how to create linked list?

kapiljain469
Newbie Poster
1 post since Sep 2009
Reputation Points: 10
Solved Threads: 0
 

The most simplifying method is a structures.
Like that

struct Node
{
    int value; //data of node
    Node *next; //pointer to a next node in the list
};

struct List
{
   Node *first;
   Node *last;
};

Implementation you will type by yourself. Good luck!

Protuberance
Junior Poster in Training
90 posts since Aug 2009
Reputation Points: 78
Solved Threads: 17
 

LinkedList

SUMMARY: In computer science, a linked list is a data structure that consists of a sequence of data records such that in each record there is a field that contains a reference (i.e., a link) to the next record in the sequence.
__avd
Posting Genius (adatapost)
Moderator
8,648 posts since Oct 2008
Reputation Points: 2,136
Solved Threads: 1,241
 

A linked list is a data structure in which it contains the nodes. a node is a structure it contains the data field and a pointer field. the data field can be anything, and the pointer field contains the address of the next node.

so the structure should be
struct Single_Linked_List
{
char name[20];// data
int rollno;// data
float fee;// data
struct Single_Linked_List *next;// pointer to the next node
};
typedef struct Single_Linked_List SLL;
now SLL can be used whereever structure can be used.
SLL *Newnode;

Gaiety
Junior Poster
120 posts since Sep 2009
Reputation Points: 13
Solved Threads: 3
 

You are right, Gaity. Don't forget to post source code with bb code tags. Read [b]announcement[b/] link at the top for each forum page.

__avd
Posting Genius (adatapost)
Moderator
8,648 posts since Oct 2008
Reputation Points: 2,136
Solved Threads: 1,241
 

Please let me know what is bb tags, and how to use that.
thanks,
Gaiety

Gaiety
Junior Poster
120 posts since Sep 2009
Reputation Points: 13
Solved Threads: 3
 
Please let me know what is bb tags, and how to use that. thanks, Gaiety


Read the material at this link: http://www.daniweb.com/forums/thread93280.html

On the front page of this forum, there are a number of threads at the top which as a "newbie", you should read as well.

yellowSnow
Posting Whiz in Training
203 posts since Jul 2009
Reputation Points: 651
Solved Threads: 35
 

how to write c programming containing linked list of students consisting of name age roll no in he ascending order of name

paradip
Newbie Poster
1 post since Oct 2009
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: