Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Explanation of what is the linked list

Status
Not open for further replies.

yanne

Newbie level 4
Joined
Aug 10, 2004
Messages
6
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
45
linked list

can someone explain to me what linked list is,, does anyone have source code which uses linked list???hope you can help me,, :?:
 

Pinczakko

Full Member level 2
Joined
Jul 29, 2004
Messages
138
Helped
13
Reputation
26
Reaction score
0
Trophy points
1,296
Location
Taka Bonerate National Park, Indonesia
Activity points
1,592
Re: linked list

linked list is a linked data structure. AFAIK, most of the time the list is implemented in C or C++ and linked together using a pointer within the data structure (i.e. pointer within the member of the linked list). Usually, "new member" of the list is allocated dynamically in memory using heap allocation function, such as malloc.

Below is an example of singly linked list in C language :
Code:
typedef struct s_LIST_MEMBER
{
int value;
struct s_LIST_MEMBER * p_next_member; /* this is the pointer to next linked-list member */
}LIST_MEMBER;

LIST_MEMBER * p_first_member = (LIST_MEMBER*) malloc(sizeof(LIST_MEMBER));

/* 
 * Now begin to fill the list 
 */
p_first_member->value = 20;
p_first_member->p_next_member = (LIST_MEMBER*) malloc(sizeof(LIST_MEMBER));

/*
 * Now we have two member, the first member and the second member  
 * which is pointed to by the    first member's p_next_members  
 * variable.
 */

Look for a software engineering or Data Structure book on C/C++ such as Djikstra's book on software engineering for more explanation on it. Also, a lot books for C/C++ language explain about it :wink:.
 

SISWANTO

Advanced Member level 4
Joined
May 14, 2001
Messages
107
Helped
6
Reputation
12
Reaction score
6
Trophy points
1,298
Location
Nirwana
Activity points
879
Re: linked list

Hi Yanne,
This is example of link list that You want.
if You have problem with it, please feeling free to PM me.
I was tried, and I never get problem.



Siswanto
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top