Subject Name : Data Structure Using C Title : Linked Lists

Slides:



Advertisements
Similar presentations
Singly linked lists Doubly linked lists
Advertisements

Stacks, Queues, and Linked Lists
DATA STRUCTURES USING C++ Chapter 5
Linked Lists Linked Lists Representation Traversing a Linked List
CHP-5 LinkedList.
DATA STRUCTURE “Linked Lists” SHINTA P STMIK MDP April 2011.
Chapter 17 Linked List Saurav Karmakar Spring 2007.
M180: Data Structures & Algorithms in Java
Linked Lists. Example We would like to keep a list of inventory records – but only as many as we need An array is a fixed size Instead – use a linked.
Data Structures: A Pseudocode Approach with C
C o n f i d e n t i a l Developed By Nitendra NextHome Subject Name: Data Structure Using C Unit : Overview of Queues.
Lecture - 1 on Data Structures. Prepared by, Jesmin Akhter, Lecturer, IIT,JU Data Type and Data Structure Data type Set of possible values for variables.
Data Structures & Algorithms
Queue using an array. .head.tail Pointers head and tail always point to the first empty slot before or after elements in the list. Thus, initially they.
Linked Lists. Example We would like to keep a list of inventory records – but only as many as we need An array is a fixed size Instead – use a linked.
Chapter 12 C Data Structures Acknowledgment The notes are adapted from those provided by Deitel & Associates, Inc. and Pearson Education Inc.
Summary of lectures (1 to 11)
© 2004 Goodrich, Tamassia Linked Lists1. © 2004 Goodrich, Tamassia Linked Lists2 Singly Linked List (§ 4.4.1) A singly linked list is a concrete data.
1 Stack Data : a collection of homogeneous elements arranged in a sequence. Only the first element may be accessed Main Operations: Push : insert an element.
C o n f i d e n t i a l Developed By Nitendra NextHome Subject Name: Data Structure Using C Title: Overview of Data Structure.
CMPSC 16 Problem Solving with Computers I Spring 2014 Instructor: Lucas Bang Lecture 15: Linked data structures.
Implementation of Linked List For more notes and topics visit: eITnotes.com.
ECE 103 Engineering Programming Chapter 61 Abstract Data Types Herbert G. Mayer, PSU CS Status 6/4/2014 Initial content copied verbatim from ECE 103 material.
Mohammad Amin Kuhail M.Sc. (York, UK) University of Palestine Faculty of Engineering and Urban planning Software Engineering Department Computer Science.
4-1 Topic 6 Linked Data Structures. 4-2 Objectives Describe linked structures Compare linked structures to array- based structures Explore the techniques.
Department of Computer Science Data Structures Using C++ 2E Chapter 5 Linked Lists.
Cousin of the Stack.  An abstract data type (container class) in which items are entered at one end and removed from the other end  First In First.
3 Data. Software And Data Data Data element – a single, meaningful unit of data. Name Social Security Number Data structure – a set of related data elements.
Chapter 11 Data Structures. Understand arrays and their usefulness. Understand records and the difference between an array and a record. Understand the.
Kovács Zita 2014/2015. II. félév DATA STRUCTURES AND ALGORITHMS 26 February 2015, Linked list.
Chapter 16 – Data Structures and Recursion. Data Structures u Built-in –Array –struct u User developed –linked list –stack –queue –tree Lesson 16.1.
1. Circular Linked List In a circular linked list, the last node contains a pointer to the first node of the list. In a circular linked list,
1 Linked Lists (Lec 6). 2  Introduction  Singly Linked Lists  Circularly Linked Lists  Doubly Linked Lists  Multiply Linked Lists  Applications.
1 Algorithms Queues, Stacks and Records stored in Linked Lists or Arrays.
Linked Lists. Introduction In linked list each item is embedded in a link Each item has two parts – Data – Pointer to the next item in the list Insert,
Data Structures Doubly and Circular Lists Lecture 07: Linked Lists
Linear Data Structures
2/21/20161 List Operations Advanced Programming Ananda Gunawardena.
Dale Roberts Department of Computer and Information Science, School of Science, IUPUI CSCI 240 Elementary Data Structures Linked Lists Linked Lists Dale.
Department of Computer Science 1 Some Practice Let’s practice for the final a little bit. OK?
 Array is a data structure were elements are stored in consecutive memory location.in the array once the memory is allocated.it cannot be extend any more.
Circular linked list A circular linked list is a linear linked list accept that last element points to the first element.
Data Structures David Kauchak cs302 Spring Data Structures What is a data structure? Way of storing data that facilitates particular operations.
Data Structure and Algorithms
Computer Science: A Structured Programming Approach Using C1 Objectives ❏ To introduce the basic concepts of linked lists ❏ To introduce the basic concepts.
Linked list: a list of items (nodes), in which the order of the nodes is determined by the address, called the link, stored in each node C++ Programming:
Linked List. LINKED LIST Link is collection of similar type of elements. There are two ways of maintaining a list in memory. The first way is store the.
Data Structure & Algorithms
UNIT-II Topics to be covered Singly linked list Circular linked list
LINKED LISTS.
© Oxford University Press All rights reserved. Data Structures Using C, 2e Reema Thareja.
Copyright © 2012 Pearson Education, Inc. Chapter 17: Linked Lists.
CPS120: Introduction to Computer Science Nell Dale John Lewis Abstract Data Types.
Linked List ADT used to store information in a list
Lecture 6 of Computer Science II
Data Structure By Amee Trivedi.
Program based on queue & their operations for an application
Data structures and algorithms
Chapter 15 Lists Objectives
UNIT-3 LINKED LIST.
LINKED LISTS CSCD Linked Lists.
Chapter 15 Lists Objectives
Arrays and Linked Lists
Sequences 11/27/2018 1:37 AM Singly Linked Lists Singly Linked Lists.
11-3 LINKED LISTS A linked list is a collection of data in which each element contains the location of the next element—that is, each element contains.
Queues A first-in, first-out or FIFO data structure.
Chapter 17: Linked Lists.
Linked Lists.
BY PROF. IRSHAD AHMAD LONE.
LINEAR DATA STRUCTURES
Presentation transcript:

Subject Name : Data Structure Using C Title : Linked Lists Home Next

Linked Lists It consists of a sequence of nodes, each containing arbitrary data fields and one or two references ("links") pointing to the next and/or previous nodes. A linked list is a self-referential data type because it contains a pointer or link to another datum of the same type. Linked lists permit insertion and removal of nodes at any point in the list in constant time, but do not allow random access. The principal benefit of a linked list over a conventional array is that the order of the linked items may be different from the order that the data items are stored in memory or on disk, allowing the list of items to be traversed in a different order. Several different types of linked list exist: Singly Linked List, Doubly Linked List, and Circular Linked List. Home Next

Hierarchical Structure of Linear List Linear Lists Restricted LIFO FIFO General Random General Ordered Home Next

There are basic FOUR operations performed on linear lists Insertion of Nodes : an insertion can be made at the any of the lists Deletion of Nodes : Deletion from general list requires that the list be searched for the data to be deleted. Retrieval of Values : List retrieval requires that data be located in a list and presented to the calling module without changing the contents of the lists. Traversal in the List : List traversal is a special case of retrieval in which all the elements are retrieved in a sequence. Home Next

Singly Linked List Doubly Linked List Circular Linked List Type of Linked Lists Singly Linked List Doubly Linked List Circular Linked List Home Next

Arbitrary Address of the Node Singly Linked List Arbitrary Address of the Node 100 300 400 200 700 6 300 100 9 400 12 200 5 700 -10 NULL Tail Node Head Node Data Part Address Part Home Next

Insertion of a Node in Singular Link List : Insert node value 45 after node value 9 100 300 400 200 700 6 300 100 9 400 -10 NULL (1) 12 200 5 700 600 Head Node Tail Node 45 NULL Insertable Node 100 300 400 200 700 (2) 6 300 100 9 600 12 200 5 700 -10 NULL 600 Head Node Tail Node 45 400 Inserted Node Home Next

Deletion of a Node in Singular Link List : Delete node value 12 100 300 400 200 700 6 300 100 9 400 12 200 5 700 -10 NULL (1) Head Node Tail Node 100 300 400 200 700 6 300 100 9 200 (2) 12 200 5 700 -10 NULL Head Node Tail Node Home Next

Doubly Linked List 9 300 NULL 100 7 600 100 86 200 300 91 NULL 600 Data Part 100 300 600 200 9 300 NULL 100 7 600 100 86 200 300 91 NULL 600 Head Node Tail Node Address Part Home Next

Insertion of a Node in Doubly Link List : Insert node value 45 after node value 7 100 300 600 200 (1) 9 300 NULL 100 7 600 100 86 200 300 91 NULL 600 700 Head Node Tail Node 45 NULL Insertable Node 100 300 600 200 9 300 NULL 100 7 700 100 86 200 700 91 NULL 600 (2) 700 Head Node Tail Node 45 600 300 Inserted Node Home Next

Deletion of a Node from Doubly Link List : Delete node value 86 100 300 600 200 (1) 9 300 NULL 100 7 600 100 86 200 300 91 NULL 600 Head Node Tail Node 100 300 600 200 9 300 NULL 100 7 200 100 86 200 300 91 NULL 300 (2) Head Node Tail Node Home Next

Circular Linked List 100 300 400 200 700 6 300 100 9 400 12 200 5 700 -10 100 Tail Node Head Node Home Next

Insertion of a Node in Circular Link List : Insert node value 44 after node value 12 100 300 400 200 700 6 300 100 9 400 12 200 5 700 -10 100 (1) 500 44 NULL Tail Node 100 300 400 200 700 6 300 100 9 400 12 500 5 700 -10 100 (2) 500 Tail Node 44 200 Home Next

Deletion of a Node from Circular Link List : Delete the node value 5 100 300 400 200 700 6 300 100 9 400 12 200 5 700 -10 100 Tail Node 100 300 400 200 700 6 300 100 9 400 12 700 5 700 -10 100 Tail Node Home Next

Application of Linked List Large Numeric Arithmetic Optimum Utilization of Memory Space Represent Complex Structure – Tree, Graph Home Next