0% found this document useful (0 votes)
5 views

An introduction to Linked List

This paper provides an overview of linked lists, a non-linear data structure, discussing their history, types, advantages, and disadvantages. It details various linked list types such as linear, circular, doubly, and header linked lists, along with operations like creation, traversal, insertion, and deletion. The authors emphasize the flexibility and efficiency of linked lists in managing data compared to traditional arrays.

Uploaded by

dchebelyon2
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

An introduction to Linked List

This paper provides an overview of linked lists, a non-linear data structure, discussing their history, types, advantages, and disadvantages. It details various linked list types such as linear, circular, doubly, and header linked lists, along with operations like creation, traversal, insertion, and deletion. The authors emphasize the flexibility and efficiency of linked lists in managing data compared to traditional arrays.

Uploaded by

dchebelyon2
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

International Journal of Research (IJR) Vol-1, Issue-10 November 2014 ISSN 2348-6848

An introduction to Linked List


Ankit Dalal1* andAnkur Atri2

Department of Information Technology, Computer Science and Information Technology,


Dronacharya College of Engineering,Gurgaon-122001, India
*E-mail: [email protected],[email protected]

Abstract:
This paper is a general overview of program codes is discussed. Linked list
non-linear data structure (Linked lists). is used to do many advanced operations
This research paper covers a brief in computer science. Linked lists are a
history of the early development of great way to store a theoretically
Linked lists and the purpose behind this infinite amount of data with a small and
to learnTypes of linked lists, advantages versatile amount of code.
and disadvantages and operations on
linked lists which includes creating a Keywords:
linked list, traversing, insertion of a
Node, reference, linked list, rpt, lpt and
node and deletion of a node with info etc.

An introduction to Linked List Ankit Dalal & Ankur Atri


P a g e 1281
International Journal of Research (IJR) Vol-1, Issue-10 November 2014 ISSN 2348-6848

History Types of linked lists


Linked lists are classified into following
Linked lists were developed in 1955-1956 categories depending upon the number of
by Allen Newell, Cliff Shaw and Harbert A. pointers on the basis of requirement and
Simon at RAND Corporation as the primary usage.
data structure for their Information 1. Linear linked list
Processing Language with which early 2. Circular linked list
artificial intelligence programs, including 3. Doubly linked list
the Logic Theory Machine, General Problem 4. Circular doubly linked list
Solver, and a Computer Chess program 5. Header linked list
were developed[1].
Definitions
Introduction
Linear Linked List

In linear linked list each node is divided into


two parts: First part contains the
information of the element. And the second
Linked lists are linear data structures. part contains the address of the next node
The data is stored in consecutive memory in the list. This means, each node has single
location. Every element in the structure has pointer to the next node[4]. The pointer of
a unique predecessor and unique successor. last node is NULL representing end of the
In this, elements are stored in a sequential linked list.
form. Linked list is among the simplest and
most commonly data structure used to Circular Linked List
store similar type of data in memory. It is a
linear collection of data elements called
nodes, where the linear order is given by
means of pointers. Every node has two
parts: first part contains the
information/data and the second part This is similar to linear linked list. But here
contains the link/address of the next node the pointer of last node is not NULL but
in the list. Linked lists provide advantage contains address of first node in the list.
over conventional arrays. The elements of
linked list is not stored in continuous
memory location[2,3]. Memory is allocated
for every node when it is actually required
and will be freed when not needed.

P a g e 1282 An introduction to Linked List Ankit Dalal & Ankur Atri


International Journal of Research (IJR) Vol-1, Issue-10 November 2014 ISSN 2348-6848

the list is sorted or not[7].

Advantages
1. Linked lists are dynamic data
structures: Memory is allocated for
every node when it is actually required
Doubly Linked List and will be freed when not needed.
Doubly inked lists are two-way lists. In this 2. The size is not fixed.

3. Data is stored in non-continues


memory blocks.

4. Insertion and deletion of nodes are


easier and efficient: Linked lists provide
case, two link fields are there (saylpt which flexibility in inserting and deleting
is predecessor pointer and rptwhich is nodes at any specified position and a
successor pointer)instead of one as in singly node can be deleted from any position
linked list. It helps accessing both the on the linked list.
successor and predecessor. The rpt of last
node is NULL[5,6]. Disadvantages
Circular Doubly Linked List More memory: In the linked list, there is an
special field called link field which holds
Circular doubly linked list is also a two-way
list which has both successor and address of the next node, so linked lists
predecessor pointer in circular manner. require more space[8].
Here rpt of last node is not NULL but
contains address of first node and lpt of first
node contains the address of last node in
the list. It is easier to perform insertion and
deletion operation in circular doubly linked
list.

Header Linked List


Header linked list always contains a single
node, called header node, at the beginning
of the linked list. This header node contains
vital information about the linked list such
as the number of nodes in the list, whether

P a g e 1283 An introduction to Linked List Ankit Dalal & Ankur Atri


International Journal of Research (IJR) Vol-1, Issue-10 November 2014 ISSN 2348-6848

Working with Linked List


Singly linear linked list

1. Creating Nodes

ii. At the end

4. Deletion in a Singly Linked List

i. From the beginning

2. Traversing of a linked list

ii. From the end

3. Insertion in a Singly Linked List

i. At the beginning

P a g e 1284 An introduction to Linked List Ankit Dalal & Ankur Atri


International Journal of Research (IJR) Vol-1, Issue-10 November 2014 ISSN 2348-6848

Conclusion 5. Cormen, Thomas H.; Charles E.


Leiserson; Ronald L. Rivest; Clifford
Linked lists are a great way to store a
Stein (2003). Introduction to
theoretically infinite amount of data with a
Algorithms. MIT Press. pp. 205–213
small and versatile amount of code. They
are great in that you can change and write & 501–505. ISBN 0-262-03293-7.
them to serve your particular needs. For 6. Cormen, Thomas H.; Charles E.
example: our lists were one directional, in Leiserson; Ronald L. Rivest; Clifford
that the individual node has no idea who is Stein (2001). "10.2: Linked
behind him in the list. This can be easily lists". Introduction to
altered by the addition of a reference to the
Algorithms (2md ed.). MIT Press.
node behind as well as in front. This will
give you greater control over the list. We pp. 204–209. ISBN 0-262-03293-7.
could also write sorting algorithms, delete 7. Green, Bert F. Jr. (1961). "Computer
functions, and any number of methods that Languages for Symbol
we find beneficial. Manipulation". IRE Transactions on
Human Factors in Electronics (2): 3–
8.doi:10.1109/THFE2.1961.4503292.
REFERENCES
8. McCarthy, John (1960). "Recursive
1. Juan, Angel (2006). "Ch20 –Data Functions of Symbolic Expressions
Structures; ID06 - PROGRAMMING and Their Computation by Machine,
with JAVA (slide part of the book Part I". Communications of the
"Big Java", by CayS. ACM 3 (4):
Horstmann)" (PDF). p. 3 184.doi:10.1145/367177.367199.
2. "Definition of a linked list". National
Institute of Standards and
Technology. 2004-08-16. Retrieved
2004-12-14.
3. Antonakos, James L.; Mansfield,
Kenneth C., Jr. (1999). Practical Data
Structures Using C/C++. Prentice-
Hall. pp. 165–190. ISBN 0-13-
280843-9.
4. Collins, William J. (2005)
[2002]. Data Structures and the Java
Collections Framework. New York:
McGraw Hill. pp. 239–303. ISBN 0-
07-282379-8.

P a g e 1285 An introduction to Linked List Ankit Dalal & Ankur Atri

You might also like