| | |
how to create linked list?
![]() |
The most simplifying method is a structures.
Like that
Implementation you will type by yourself. Good luck!
Like that
c Syntax (Toggle Plain Text)
struct Node { int value; //data of node Node *next; //pointer to a next node in the list }; struct List { Node *first; Node *last; };
"If a problem can be decided - it is not needed to worry, and if to decide it is impossible - worrying is useless." (с)
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.
Failure is not fatal, but failure to change might be. - John Wooden
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;
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;
Last edited by Gaiety; Sep 5th, 2009 at 3:23 am. Reason: added some extra content
•
•
•
•
Please let me know what is bb tags, and how to use that.
thanks,
Gaiety
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.
Manic twiddler of bits
![]() |
Similar Threads
- linked list - how to create list (C++)
- Removing an item from head of linked list (C)
- problem about linked list. (C++)
- Deleting In Linked List.. (C++)
- Linked List in Pascal (Pascal and Delphi)
- how to make a linked list to sort acsending order (C++)
- linked list errors (C++)
- Linked List using pointers (C++ ADT) (C++)
Other Threads in the C Forum
- Previous Thread: Leap year program In C
- Next Thread: Avoiding End-of-line (\n) after using Scanf.
| Thread Tools | Search this Thread |







