LIST Unsorted 1.Set PTR := START 2.Repeat Step 3 while PTR=NULL 3.If ITEM = INFO[PTR], then : Set LOC := PTR and Exit else Set PTR:=LINK[PTR] [PTR points.

Slides:



Advertisements
Similar presentations
Linked Lists Linked Lists Representation Traversing a Linked List
Advertisements

Data Structures Using C++
CHP-5 LinkedList.
Singly Linked List BTECH, EE KAZIRANGA UNIVERSITY.
Data Structure Lecture-3 Prepared by: Shipra Shukla Assistant Professor Kaziranga University.
Data Structures & Algorithms
C++ Programming: Program Design Including Data Structures, Third Edition Chapter 17: Linked Lists.
C++ Programming: Program Design Including Data Structures, Fifth Edition Chapter 17: Linked Lists.
Variations of Linked Lists CS 308 – Data Structures.
C o n f i d e n t i a l Developed By Nitendra HOME NEXT Subject Name: Data Structure Using C Unit Title: Searching Methods.
UNIT 1 Data Structures Using C Linked List By Rohit Khokher Department of Computer Science, Vidya College of Engineering, Meerut, India.
Arrays.
Data Strcutures.
Data Structures Using Java1 Chapter 4 Linked Lists.
Chapter 1 Object Oriented Programming. OOP revolves around the concept of an objects. Objects are created using the class definition. Programming techniques.
Department of Computer Science Data Structures Using C++ 2E Chapter 5 Linked Lists.
Data Structures Using C++1 Chapter 5 Linked Lists.
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,
C++ Programming: Program Design Including Data Structures, Fourth Edition Chapter 17: Linked Lists (part 3)
Dale Roberts Department of Computer and Information Science, School of Science, IUPUI CSCI 240 Elementary Data Structures Linked Lists Linked Lists Dale.
Linked List X Header X 4000 ptr Question: Search a value 40 in the linked list. Steps: ptr = Header->Link While(ptr.
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.
Chapter 17: Linked Lists. Objectives In this chapter, you will: – Learn about linked lists – Learn the basic properties of linked lists – Explore insertion.
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:
Link List Submitted by Submitted to Mukesh (5765) Er.Dheeraj Maam Vijender(5755) Lect. In Comp. sc. BCA 2 nd Year.
Part 2. Deletion from a linked list Let LIST be a linked list with a node N between nodes A and B. suppose node N is to be deleted from the linked list.
C++ Programming: Program Design Including Data Structures, Fourth Edition Chapter 17: Linked Lists.
C++ Programming: From Problem Analysis to Program Design, Fourth Edition Chapter 18: Linked Lists.
CHAPTER 51 LINKED LISTS. Introduction link list is a linear array collection of data elements called nodes, where the linear order is given by means of.
1. Traversing a linear array Here A is a linear array with lower bound LB and upper bound UB. This algorithm traverses A applying an operation PROCESS.
Sorting and Searching Bubble Sort Linear Search Binary Search.
Code: BCA302 Data Structures with C Prof. (Dr.) Monalisa Banerjee By.
  A linked list is a collection of components called nodes  Every node (except the last one) contains the address of the next node  The address of.
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.
Part 2. Deletion from a linked list Let LIST be a linked list with a node N between nodes A and B. suppose node N is to be deleted from the linked list.
Trees Binary Trees Extended Binary Trees. Tree A Tree consist of Nodes connected by Edges. Node is represented by Circle Edges as Lines or Arrows A Tree.
Copyright © 2004 – 2006 – Curt Hill Linked Lists Very Powerful Data Structure.
1 Linked list. 1 A linked list, or one-way list, is a linear collection of data elements, called nodes Each node is divided into two parts: * first part.
Chapter 16: Linked Lists.
Linked List ADT used to store information in a list
C++ Programming:. Program Design Including
[Chapter 4; Chapter 6, pp ] CSC 143 Linked Lists (cont) [Chapter 4; Chapter 6, pp ]
Data Structure By Amee Trivedi.
Lectures linked lists Chapter 6 of textbook
Program based on queue & their operations for an application
Review Deleting an Element from a Linked List Deletion involves:
Trees.
Trees ---- Soujanya.
Prepared by, Jesmin Akhter, Lecturer, IIT, JU
Very Powerful Data Structure
Lecture - 6 On Data Structures
UNIT-3 LINKED LIST.
Linked-list.
Linked lists.
Linked Lists A linked list or one way list is a linear collection of data elements called nodes where the order is given by means of pointers It is divided.
LINKED LISTS CSCD Linked Lists.
INSERTION INTO A LINEAR ARRAY Set J = N Repeat step 3 and 4 while J>= K Set LA[ J+1] = LA [ J ] Set J = J-1 Set LA [K] = ITEM Set N = N+1 Exit.
Doubly Linked Lists or Two-way Linked Lists
LINKED LIST.
Data Structures: Searching
CSCI 104 Skip Lists Mark Redekopp.
Linked Lists.
Binary Search Tree (BST)
Linked lists.
Chapter 9 Linked Lists.
LINEAR DATA STRUCTURES
Presentation transcript:

LIST Unsorted 1.Set PTR := START 2.Repeat Step 3 while PTR=NULL 3.If ITEM = INFO[PTR], then : Set LOC := PTR and Exit else Set PTR:=LINK[PTR] [PTR points to next node] [End of If structure] [End of Step 2 loop] 4.[Search unsuccessful] Set LOC:=NULL 5. Exit

LIST Sorted 1.Set PTR := START 2.Repeat Step 3 while PTR=NULL 3.If ITEM < INFO[PTR], then : Set PTR:=LINK[PTR] [move to next node] elseif ITEM = INFO[PTR], then: Set LOC := PTR and Exit [search successful] else: Set LOC:=NULL and exit [ITEM exceeds INFO[PTR]] [End of If structure] [End of Step 2 loop] 4.[Search unsuccessful] Set LOC:=NULL 5. Exit

Header Linked List A header linked list is the LL which will always contain a special node called “header node” at the beginning of the list. START pointer will now point to the HEADER NODE and HEADER NODE will now point to the first “actual node” of linked list.

Header Linked List a) Grounded header LL b) Circular header LL a) Grounded header LL b) Circular header LL START N Header Node

Polynomial

Two way lists In one way link list we can traverse in one direction, i.e. in forward direction from START We cannot traverse in backward direction or we can’t access the preceding nodes without traversing the part of LL

Two way lists In two way LL, we can traverse in two direction: 1) Forward direction from beginning of LL to its end 2) Backward direction from end of LL to its beginning Also we now access to both next and previous node of the LL.

Two way lists Each node now contains three parts: 1)INFO : contain data 2)FORW: contain address of next node 3)BACK: contain address of previous node

Two way circular header LL