Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Sponsored Links



What is a linked list?

Software Development


Reply
 
Thread Tools Search this Thread
  #1  
Old 28-11-2009
Member
 
Join Date: Nov 2009
Posts: 51
What is a linked list?
  

Hello,
I am T.Y.B.Sc. student. As per our syllabus we have C programming language. I recently started learning C language. In our last tutorial our sir has asked question What is a linked list? I had never heard this type of any term that's why I unable to write it's answer. Please if you have any idea about this term share with me.
Thanks in advanced.

Reply With Quote
  #2  
Old 28-11-2009
Member
 
Join Date: May 2008
Posts: 2,293
Re: What is a linked list?

Linked list is a type of datastructure that collect either different type of data or same type of data. These data are basically stored in node. Usually node have non primitive data that are stored in to two parts. One part have data and other part have address of next node.
Reply With Quote
  #3  
Old 28-11-2009
Member
 
Join Date: Oct 2005
Posts: 2,389
Re: What is a linked list?

Linked list is a type of datastructure made up of nodes that collect various data. Each node have two parts one is Information part and other is linked part.
1.Information part=This part contain value of data elements.
2.linked part=This part contains address of the next node or adjacent node.
In Linked list we stored information linear format.
Reply With Quote
  #4  
Old 28-11-2009
Member
 
Join Date: May 2008
Posts: 2,383
Re: What is a linked list?

A linked list is collection of data in linear format. It consist of nodes. All nodes are linearly connected. The linear format is supported by pointer. You can find linked list in either doubly or liner or circular format.
__________________
The FIFA Manager 2009 PC Game
Reply With Quote
  #5  
Old 28-11-2009
Member
 
Join Date: Feb 2008
Posts: 1,848
Re: What is a linked list?

Here I just given you program to understand linked list.
Code:
Basic linked list example

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

struct Linkedlist {
 char *str1;
 struct Linkedlist *next1;
};

int main(void) {
 char line[1024];
 struct Linkedlist *h = NULL;
 struct Linkedlist *n = NULL;

 while(fgets(line, 1024, stdin) != NULL) {
  n = (struct Linkedlist *)malloc(sizeof(struct Linkedlist));
  n->next1 = h;
  h = n;

  n->str1 = strdup(line);
 }

 while(h != NULL) {
  printf("%s\n", h->str1);
  h = h->next1;
 }

 return 0;
}
Reply With Quote
  #6  
Old 28-11-2009
Member
 
Join Date: Feb 2009
Posts: 96
Re: What is a linked list?

Since most people tend to always give absolute definitions I'll try to explain it in layman's terms.
a linked list is a list of items that in some way relate to each other to create a kind of data structure that can be read through and manipulated easier. like links of a chain.
example

you can have 2 linked lists that work with each other.
1 can be prices of seats of and airline
and the other can be a list of passengers for the airline and the seat they reserved.
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "What is a linked list?"
Thread Thread Starter Forum Replies Last Post
Problem with Java linked list XeroX Software Development 1 13-06-2012 03:37 PM
Joomla Linked up files no able to list Jahnavi6 Technology & Internet 4 15-07-2010 02:39 AM
Dynamic Linked List In Jsp rashmi_ay Software Development 5 23-02-2010 10:50 PM
Problem using Linked list in java Aaliya Seth Software Development 5 18-02-2010 01:06 AM
Better way to sort a linked list in c++ Juany Software Development 5 13-02-2010 04:30 PM


All times are GMT +5.5. The time now is 09:13 PM.