SlideShare una empresa de Scribd logo
1 de 28
Dgroup@mca.com   ************




Presentation
     ON




     BY
  D Group
Member of D group
      Privanka Dabhai
      Insert at first in single linked list

       Praful Aparnathi
       Insert at Last in single linked list

       Arpan Shah
       Insert at Order in single linked list

       Narendra Chauhan
       Delete in single linked list

       Ram Sanjay
       Copy in single linked list

       Rushabh Bhavsar
       MCQ

       Bhavisha Purohit
Index Of Linear Linked List



     INDEX
  1.Introduction
  2.Algorithms
  3.MCQ
Introduction Of Linked List

  Introduction Of Linked List

This subsection describes in detail the
representation of linear lists using linked
allocation. Algorithms such as the insertion of
nodes and the deletion of nodes from a linked
linear list are given.

The programming aspects of linked allocation
are discussed both from the simulation point of
view, using arrays, and from the programmer
defined data type facility available in pascal.
Introduction Of Linked List

  Introduction Of Linked List

The first approach is the one which is usually taken in
programming linked represented structures in languages
that do not have pointer or link facilities, such as
FORTRAN,ALGOL 60 and BASIC, while the second
approach is used in languages that do have pointer
facilities, such as Pascal, PL/ISNOBOL,ALGOL 68 and
ALGOL W.
Introduction Of Linked List

Introduction Of Linked List




                     info     Link
Introduction Of Linked List

        Introduction Of Linked List
The pointer variable AVAIL contains the address of the top
node in the stack. The address of the next available node
is to be stored in the variable NEW.

If a node is available then the new top most element of the
stack is denoted by LINK(AVAIL). The fields of the node
corresponding to the pointer value of NEW can now be
filled in and the field LINK(NEW) is set to a value which
designates the successor node of this new node.
Introduction Of Linked List
A similar procedure can be formulated for the
return of a discarded node to the availability
stack. If the address of this discarded node is
given by the variable FREE, then the link field
of this node is set to the present value of
AVAIL and the value of FREE becomes the
new value of AVAIL.

We can now formulate an algorithm which
inserts a node into a linked linear list in a
stack like manner.
Algorithms of Linked List


   Algorithms
  →   Insert at first in single linked list
  →   Insert at Last in single linked list
  →   Insert at Order in single linked list
  →   Delete in single linked list
  →   Copy in single linked list
Insert at first in single linked

              Insert at first in single linked list


INSERT(X,FIRST)

    Where X is a new element and FIRST, a pointer to the first element
of a linked linear list whose typical node contains INFO and LINK fields
as previously described, this function insert X. AVAIL is a pointer to the
top element of the availability stack; NEW is a temporary pointer
variable. It is required that X precede the node whose address is given
to the FIRST.
INSERT(X,FIRST) linked list

              Insert at first in single linked list
Step 1: [Underflow?]
         if AVAIL= NULL
         Then write (“Availability stack underflow”)
                 return (FIRST)

               Step 2: [Obtain address of next free node]
                      NEW ←AVAIL
Step 3: [Remove free node from availability
node]
        AVAIL ← Step 4: [Initialize fields node from availability
                LINK(AVAIL)
                  stack]
                       INFO(NEW) ← X
                       LINK(NEW) ← FIRST
Step 5: [Return address of new node]
        Return(NEW)
INSERT_LAST(X,FIRST)


             Insert at Last in single linked list

INSERT_LAST(X,FIRST)

          Where X is a new element and FIRST, a pointer to the first
element of a linked linear list whose typical node contains INFO and
LINK fields as previously described, this function insert X. AVAIL is a
pointer to the top element of the availability stack; NEW & SAVE are
temporary pointer variable. It is required that X be inserted at the end of
the list.
INSERT_LAST(X,FIRST)


 Insert at Last in single linked list
Step 1: [Underflow?]
         if AVAIL= NULL
         then write (“Availability stack underflow”)
                  return (FIRST)

Step 2: [Obtain address of next free node]
         NEW ← AVAIL

Step 3: [Remove free node from availability node]
         AVAIL ← LINK(AVAIL)

Step 4: [Initialize fields node from availability stack]
          INFO(NEW) ← X
          LINK(NEW) ← NULL
INSERT_LAST(X,FIRST)


 Insert at Last in single linked list
Step 5: [Is the list EMPTY?]
          if FIRST= NULL
          then Return(NEW)

Step 6: [Initiate search for the last node]
          SAVE ← FIRST

Step 7 : [Search for end of list]
          Repeat while LINK(SAVE) ≠ NULL
          SAVE ← LINK(SAVE)

Step 8 : [Set LINK Field of last node to NEW]
          LINK(SAVE) ← NEW

Step 9: [Return first node]
         Return(FIRST)
INSERT_ORD(X,FIRST)

             Insert at Order in single linked list




INSERT_ORD(X,FIRST)

             Where X is a new element and FIRST, a pointer to the first
element of a linked linear list whose typical node contains INFO and
LINK fields as previously described, AVAIL is a pointer to the top
element of the availability stack; NEW & SAVE are temporary pointer
variable. It is required that X be inserted so that it preserves the ordering
of the terms in increasing order of their INFO fields.
INSERT_ORD(X,FIRST)

 Insert at Order in single linked list
Step 1: [Underflow?]
         if AVAIL= NULL
         then write (“Availability stack underflow”)
         return (FIRST)

Step 2: [Obtain address of next free node]
         NEW ← AVAIL

Step 3: [Remove free node from availability node]
         AVAIL ← LINK(AVAIL)

Step 4: [Copy information contents into new node]
         INFO(NEW) ← X

Step 5: [Is the list EMPTY?]
          if FIRST= NULL
          then Return(NEW)
INSERT_ORD(X,FIRST)

             Insert at Order in single linked list
Step 6: [Does the new node precede all others in the list?]
         if INFO(NEW) ≤ INFO(FIRST)
         then LINK(NEW) ← FIRST
         Return(NEW)

Step 7 : [Initialize temporary pointer]
          SAVE ← FIRST

Step 8 : [Search for predecessor of new node]
          Repeat while LINK(SAVE) ≠ NULL and INFO(LINK(SAVE)) ≤ INFO (NEW)
          SAVE ← LINK(SAVE)

Step 9 : [Set LINK Field of new node and its predecessor]
          LINK(NEW) ← LINK(SAVE)
          LINK(SAVE) ← NEW

Step 10: [Return first node]
         Return(FIRST)
DELETE(X,FIRST)

Delete in single linked list


       Where X and FIRST, pointer Variable
whose values denote the address of a node
in linked list and the address of the first
node in the linked list, respectively, this
procedure deletes the node whose address
is given by X. TEMP is used to find the
desired node, and PRED keeps track of the
predecessor of TEMP. note that FIRST is
changed only when X is the first elements
of the list.
DELETE(X,FIRST)

Delete in single linked list
Step 1: [EMPTY LIST?]
          if FIRST= NULL
          then write (“Underflow”)
          return

Step 2: [Initialize search for X]
          TEMP ← FIRST

Step 3: [Find X]
         Repeat thru Step 5 while TEMP ≠ x and
         LINK(TEMP) ≠ NULL

Step 4: [Update Predecessor Marker ]
         PRED ← TEMP

Step 5: [Move to next node]
         TEMP ← LINK(TEMP)
DELETE(X,FIRST)

Delete in single linked list
Step 6: [End of the list?]
         if TEMP ≠ X
         then write(„NODE NOT FOUND”)
         return

Step 7: [Delete X]
         if X = FIRST (is X the First NODE?)
         then FIRST ← LINK(FIRST)
         else LINK(PRED) ← LINK(X)

Step 8 : [Return node to availability area]
          LINK(X) ← AVAIL
          AVAIL ← X
          return
COPY(FIRST)

 Copy in single linked list

         Given FIRST, a pointer to the first
node in the linked list, this function makes a
copy of this list. A typical node in the given
list consists of INFO and LINK fields. The new
list is to contain nodes whose information
and pointer fields are denoted by FIELD and
PTR, respectively. The address of the first
node in the newly created list is to be placed
in BEGIN. NEW,SAVE and PRED are pointer
variable.
COPY(FIRST)

 Copy in single linked list
Step 1: [EMPTY LIST?]
         if FIRST= NULL
         then write (“Underflow”)
                   return

Step 2: [Copy first node]
         if AVAIL = NULL
         then write(„Availability Stack UNDERFLOW‟)
         return(0)
                   else NEW ← AVAIL
                   AVAIL ← LINK(AVAIL)
                   FIELD(NEW) ← INFO(FIRST)
                   BEGIN ← NEW

Step 3: [Initialize traversal]
SAVE ← FIRST
COPY(FIRST)

Copy in single linked list
Step 4: [Move to next node if not at the end of list]
         Repeat through step 6 while LINK(SAVE) ≠ NULL

Step 5: [Update Predecessor and save pointers ]
         PRED ← NEW
         SAVE ← LINK(SAVE)

Step 6: [Copy Node]
         if AVAIL = NULL
         then write(„Availability Stack UNDERFLOW‟)
         return(0)
                  else NEW ← AVAIL
                  AVAIL ← LINK(AVAIL)
                  FIELD(NEW) ← INFO(SAVE)
                  PTR(PRED) ← NEW
COPY(FIRST)

Copy in single linked list
Step 7 : [Set Link of last node and return]
          PTR(NEW) ← NULL
          Return NULL
          return
Linear Linked List MCQ PPT
Linear Linked List MCQ PPT

1)A linear Structure in which the individual elements are joined together by
references to other elements in the structure is known as a_________
•Tree (b) Vector (c) Linked list (d) Table

2)A list that restricts insertions and removals to the front ( or top ) is known as a
(b) Linked list (b) stack (c) queue (d) frontal List

3)To Access an item in a singly linked list you must usa a _______ algorithm.
(b) Traversal (b) access (c) removal (d) insertion

4)Linked lists are collections of data items “lined up in row”-insertions and deletion can be made
     only at the front and the back of a linked list.
(b) TRUE (b) FALSE


5)Self-referential objects can be linked together to from useful data structures such as
     lists,queues,stacks and tree
(a) TRUE (b) FALSE
Linear Linked List MCQ PPT

6)The situation when in a linked list START=NULL is
(a) Underflow (b) overflow (c) housefull (d) saturated

7)The link field in the last node of the linked list contains
(a) NULL (b) link to the first node (c) pointer to the next element (d) Zero value
8)To delete a node at the beginning of the list, the location of the list is modified as the
     address of the.
(a) Second element in the list (b)First element in the list (c) Last element in the list.

9) In the linked list representation of the stacks, the top of the stack is represented by
(a)The last node (b) Any of the nodes (c) First node


10) A linked list in which the last node points to the first is called a
(a) Doubly linked list (b) Circular list (c) Generalized list
THANK
 YOU

Más contenido relacionado

La actualidad más candente

Link list presentation slide(Daffodil international university)
Link list presentation slide(Daffodil international university)Link list presentation slide(Daffodil international university)
Link list presentation slide(Daffodil international university)shah alom
 
Linked lists in Data Structure
Linked lists in Data StructureLinked lists in Data Structure
Linked lists in Data StructureMuhazzab Chouhadry
 
Doubly & Circular Linked Lists
Doubly & Circular Linked ListsDoubly & Circular Linked Lists
Doubly & Circular Linked ListsAfaq Mansoor Khan
 
Unit ii(dsc++)
Unit ii(dsc++)Unit ii(dsc++)
Unit ii(dsc++)Durga Devi
 
Circular linked list
Circular linked listCircular linked list
Circular linked listmaamir farooq
 
Linked List Static and Dynamic Memory Allocation
Linked List Static and Dynamic Memory AllocationLinked List Static and Dynamic Memory Allocation
Linked List Static and Dynamic Memory AllocationProf Ansari
 
Circular link list.ppt
Circular link list.pptCircular link list.ppt
Circular link list.pptTirthika Bandi
 
Circular linked list
Circular linked listCircular linked list
Circular linked listdchuynh
 
header, circular and two way linked lists
header, circular and two way linked listsheader, circular and two way linked lists
header, circular and two way linked listsstudent
 
linked list using c
linked list using clinked list using c
linked list using cVenkat Reddy
 
Array implementation and linked list as datat structure
Array implementation and linked list as datat structureArray implementation and linked list as datat structure
Array implementation and linked list as datat structureTushar Aneyrao
 
linked list (c#)
 linked list (c#) linked list (c#)
linked list (c#)swajahatr
 

La actualidad más candente (19)

Link List
Link ListLink List
Link List
 
Link list presentation slide(Daffodil international university)
Link list presentation slide(Daffodil international university)Link list presentation slide(Daffodil international university)
Link list presentation slide(Daffodil international university)
 
Linked lists in Data Structure
Linked lists in Data StructureLinked lists in Data Structure
Linked lists in Data Structure
 
Doubly & Circular Linked Lists
Doubly & Circular Linked ListsDoubly & Circular Linked Lists
Doubly & Circular Linked Lists
 
Unit ii(dsc++)
Unit ii(dsc++)Unit ii(dsc++)
Unit ii(dsc++)
 
Linked list
Linked listLinked list
Linked list
 
Linked lists a
Linked lists aLinked lists a
Linked lists a
 
linked list
linked listlinked list
linked list
 
Circular linked list
Circular linked listCircular linked list
Circular linked list
 
Linked List Static and Dynamic Memory Allocation
Linked List Static and Dynamic Memory AllocationLinked List Static and Dynamic Memory Allocation
Linked List Static and Dynamic Memory Allocation
 
Circular link list.ppt
Circular link list.pptCircular link list.ppt
Circular link list.ppt
 
Circular linked list
Circular linked listCircular linked list
Circular linked list
 
header, circular and two way linked lists
header, circular and two way linked listsheader, circular and two way linked lists
header, circular and two way linked lists
 
Singly & Circular Linked list
Singly & Circular Linked listSingly & Circular Linked list
Singly & Circular Linked list
 
linked list using c
linked list using clinked list using c
linked list using c
 
Linked lists
Linked listsLinked lists
Linked lists
 
Linked list
Linked listLinked list
Linked list
 
Array implementation and linked list as datat structure
Array implementation and linked list as datat structureArray implementation and linked list as datat structure
Array implementation and linked list as datat structure
 
linked list (c#)
 linked list (c#) linked list (c#)
linked list (c#)
 

Destacado

6. Linked list - Data Structures using C++ by Varsha Patil
6. Linked list - Data Structures using C++ by Varsha Patil6. Linked list - Data Structures using C++ by Varsha Patil
6. Linked list - Data Structures using C++ by Varsha Patilwidespreadpromotion
 
358 33 powerpoint-slides_8-linked-lists_chapter-8
358 33 powerpoint-slides_8-linked-lists_chapter-8358 33 powerpoint-slides_8-linked-lists_chapter-8
358 33 powerpoint-slides_8-linked-lists_chapter-8sumitbardhan
 
Searching and Sorting Techniques in Data Structure
Searching and Sorting Techniques in Data StructureSearching and Sorting Techniques in Data Structure
Searching and Sorting Techniques in Data StructureBalwant Gorad
 
Doubly linked list
Doubly linked listDoubly linked list
Doubly linked listFahd Allebdi
 
Trees data structure
Trees data structureTrees data structure
Trees data structureSumit Gupta
 
Double linked list
Double linked listDouble linked list
Double linked listraviahuja11
 
Data structure using c module 1
Data structure using c module 1Data structure using c module 1
Data structure using c module 1smruti sarangi
 
Individual-In-The-Loop (for Ethically Aligned Artificial Intelligence)
Individual-In-The-Loop (for Ethically Aligned Artificial Intelligence)Individual-In-The-Loop (for Ethically Aligned Artificial Intelligence)
Individual-In-The-Loop (for Ethically Aligned Artificial Intelligence)John C. Havens
 
Insertion and Deletion in Binary Search Trees (using Arrays and Linked Lists)
Insertion and Deletion in Binary Search Trees (using Arrays and Linked Lists)Insertion and Deletion in Binary Search Trees (using Arrays and Linked Lists)
Insertion and Deletion in Binary Search Trees (using Arrays and Linked Lists)Lovelyn Rose
 
Linked List, Types of Linked LIst, Various Operations, Applications of Linked...
Linked List, Types of Linked LIst, Various Operations, Applications of Linked...Linked List, Types of Linked LIst, Various Operations, Applications of Linked...
Linked List, Types of Linked LIst, Various Operations, Applications of Linked...Balwant Gorad
 
Binary Search Tree
Binary Search TreeBinary Search Tree
Binary Search TreeAbhishek L.R
 
Open Legal Data Workshop at Stanford
Open Legal Data Workshop at StanfordOpen Legal Data Workshop at Stanford
Open Legal Data Workshop at StanfordHarry Surden
 
Harry Surden - Artificial Intelligence and Law Overview
Harry Surden - Artificial Intelligence and Law OverviewHarry Surden - Artificial Intelligence and Law Overview
Harry Surden - Artificial Intelligence and Law OverviewHarry Surden
 
AI and Machine Learning Demystified by Carol Smith at Midwest UX 2017
AI and Machine Learning Demystified by Carol Smith at Midwest UX 2017AI and Machine Learning Demystified by Carol Smith at Midwest UX 2017
AI and Machine Learning Demystified by Carol Smith at Midwest UX 2017Carol Smith
 

Destacado (18)

6. Linked list - Data Structures using C++ by Varsha Patil
6. Linked list - Data Structures using C++ by Varsha Patil6. Linked list - Data Structures using C++ by Varsha Patil
6. Linked list - Data Structures using C++ by Varsha Patil
 
7 Myths of AI
7 Myths of AI7 Myths of AI
7 Myths of AI
 
Linked list
Linked listLinked list
Linked list
 
358 33 powerpoint-slides_8-linked-lists_chapter-8
358 33 powerpoint-slides_8-linked-lists_chapter-8358 33 powerpoint-slides_8-linked-lists_chapter-8
358 33 powerpoint-slides_8-linked-lists_chapter-8
 
Searching and Sorting Techniques in Data Structure
Searching and Sorting Techniques in Data StructureSearching and Sorting Techniques in Data Structure
Searching and Sorting Techniques in Data Structure
 
Linked list
Linked listLinked list
Linked list
 
Doubly linked list
Doubly linked listDoubly linked list
Doubly linked list
 
Trees data structure
Trees data structureTrees data structure
Trees data structure
 
Double linked list
Double linked listDouble linked list
Double linked list
 
Data structure using c module 1
Data structure using c module 1Data structure using c module 1
Data structure using c module 1
 
Individual-In-The-Loop (for Ethically Aligned Artificial Intelligence)
Individual-In-The-Loop (for Ethically Aligned Artificial Intelligence)Individual-In-The-Loop (for Ethically Aligned Artificial Intelligence)
Individual-In-The-Loop (for Ethically Aligned Artificial Intelligence)
 
Insertion and Deletion in Binary Search Trees (using Arrays and Linked Lists)
Insertion and Deletion in Binary Search Trees (using Arrays and Linked Lists)Insertion and Deletion in Binary Search Trees (using Arrays and Linked Lists)
Insertion and Deletion in Binary Search Trees (using Arrays and Linked Lists)
 
Cyber Crime
Cyber CrimeCyber Crime
Cyber Crime
 
Linked List, Types of Linked LIst, Various Operations, Applications of Linked...
Linked List, Types of Linked LIst, Various Operations, Applications of Linked...Linked List, Types of Linked LIst, Various Operations, Applications of Linked...
Linked List, Types of Linked LIst, Various Operations, Applications of Linked...
 
Binary Search Tree
Binary Search TreeBinary Search Tree
Binary Search Tree
 
Open Legal Data Workshop at Stanford
Open Legal Data Workshop at StanfordOpen Legal Data Workshop at Stanford
Open Legal Data Workshop at Stanford
 
Harry Surden - Artificial Intelligence and Law Overview
Harry Surden - Artificial Intelligence and Law OverviewHarry Surden - Artificial Intelligence and Law Overview
Harry Surden - Artificial Intelligence and Law Overview
 
AI and Machine Learning Demystified by Carol Smith at Midwest UX 2017
AI and Machine Learning Demystified by Carol Smith at Midwest UX 2017AI and Machine Learning Demystified by Carol Smith at Midwest UX 2017
AI and Machine Learning Demystified by Carol Smith at Midwest UX 2017
 

Similar a linked list

Array linked list.ppt
Array  linked list.pptArray  linked list.ppt
Array linked list.pptWaf1231
 
Bsc cs ii dfs u-2 linklist,stack,queue
Bsc cs ii  dfs u-2 linklist,stack,queueBsc cs ii  dfs u-2 linklist,stack,queue
Bsc cs ii dfs u-2 linklist,stack,queueRai University
 
Bca ii dfs u-2 linklist,stack,queue
Bca ii  dfs u-2 linklist,stack,queueBca ii  dfs u-2 linklist,stack,queue
Bca ii dfs u-2 linklist,stack,queueRai University
 
Mca ii dfs u-3 linklist,stack,queue
Mca ii dfs u-3 linklist,stack,queueMca ii dfs u-3 linklist,stack,queue
Mca ii dfs u-3 linklist,stack,queueRai University
 
Data Structures in C++I am really new to C++, so links are really .pdf
Data Structures in C++I am really new to C++, so links are really .pdfData Structures in C++I am really new to C++, so links are really .pdf
Data Structures in C++I am really new to C++, so links are really .pdfrohit219406
 
Unit 2 linked list and queues
Unit 2   linked list and queuesUnit 2   linked list and queues
Unit 2 linked list and queueskalyanineve
 
Data Structure Lecture 7
Data Structure Lecture 7Data Structure Lecture 7
Data Structure Lecture 7Teksify
 
Lec-4_Linked-List (1).pdf
Lec-4_Linked-List (1).pdfLec-4_Linked-List (1).pdf
Lec-4_Linked-List (1).pdfKylaMaeGarcia1
 
ds 4Linked lists.ppt
ds 4Linked lists.pptds 4Linked lists.ppt
ds 4Linked lists.pptAlliVinay1
 
List Data Structure
List Data StructureList Data Structure
List Data StructureZidny Nafan
 

Similar a linked list (20)

Stack q ll algo
Stack q ll algoStack q ll algo
Stack q ll algo
 
Algo>ADT list & linked list
Algo>ADT list & linked listAlgo>ADT list & linked list
Algo>ADT list & linked list
 
linked-list.ppt
linked-list.pptlinked-list.ppt
linked-list.ppt
 
Array linked list.ppt
Array  linked list.pptArray  linked list.ppt
Array linked list.ppt
 
Bsc cs ii dfs u-2 linklist,stack,queue
Bsc cs ii  dfs u-2 linklist,stack,queueBsc cs ii  dfs u-2 linklist,stack,queue
Bsc cs ii dfs u-2 linklist,stack,queue
 
List
ListList
List
 
Bca ii dfs u-2 linklist,stack,queue
Bca ii  dfs u-2 linklist,stack,queueBca ii  dfs u-2 linklist,stack,queue
Bca ii dfs u-2 linklist,stack,queue
 
Mca ii dfs u-3 linklist,stack,queue
Mca ii dfs u-3 linklist,stack,queueMca ii dfs u-3 linklist,stack,queue
Mca ii dfs u-3 linklist,stack,queue
 
Abstract data types
Abstract data typesAbstract data types
Abstract data types
 
Data Structures in C++I am really new to C++, so links are really .pdf
Data Structures in C++I am really new to C++, so links are really .pdfData Structures in C++I am really new to C++, so links are really .pdf
Data Structures in C++I am really new to C++, so links are really .pdf
 
Linked list
Linked list Linked list
Linked list
 
Unit 2 linked list and queues
Unit 2   linked list and queuesUnit 2   linked list and queues
Unit 2 linked list and queues
 
3.ppt
3.ppt3.ppt
3.ppt
 
3.ppt
3.ppt3.ppt
3.ppt
 
Data structures2
Data structures2Data structures2
Data structures2
 
Data Structure Lecture 7
Data Structure Lecture 7Data Structure Lecture 7
Data Structure Lecture 7
 
Lec-4_Linked-List (1).pdf
Lec-4_Linked-List (1).pdfLec-4_Linked-List (1).pdf
Lec-4_Linked-List (1).pdf
 
ds 4Linked lists.ppt
ds 4Linked lists.pptds 4Linked lists.ppt
ds 4Linked lists.ppt
 
List data structure
List data structure List data structure
List data structure
 
List Data Structure
List Data StructureList Data Structure
List Data Structure
 

Último

ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxAnupkumar Sharma
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)lakshayb543
 
FILIPINO PSYCHology sikolohiyang pilipino
FILIPINO PSYCHology sikolohiyang pilipinoFILIPINO PSYCHology sikolohiyang pilipino
FILIPINO PSYCHology sikolohiyang pilipinojohnmickonozaleda
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...JhezDiaz1
 
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...Postal Advocate Inc.
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Jisc
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Celine George
 
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYKayeClaireEstoconing
 
Karra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxKarra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxAshokKarra1
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designMIPLM
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPCeline George
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...Nguyen Thanh Tu Collection
 
Culture Uniformity or Diversity IN SOCIOLOGY.pptx
Culture Uniformity or Diversity IN SOCIOLOGY.pptxCulture Uniformity or Diversity IN SOCIOLOGY.pptx
Culture Uniformity or Diversity IN SOCIOLOGY.pptxPoojaSen20
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parentsnavabharathschool99
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfMr Bounab Samir
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxHumphrey A Beña
 

Último (20)

ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
 
FILIPINO PSYCHology sikolohiyang pilipino
FILIPINO PSYCHology sikolohiyang pilipinoFILIPINO PSYCHology sikolohiyang pilipino
FILIPINO PSYCHology sikolohiyang pilipino
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
 
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...
 
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptxYOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17
 
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
 
Karra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxKarra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptx
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-design
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERP
 
Raw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptxRaw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptx
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
 
Culture Uniformity or Diversity IN SOCIOLOGY.pptx
Culture Uniformity or Diversity IN SOCIOLOGY.pptxCulture Uniformity or Diversity IN SOCIOLOGY.pptx
Culture Uniformity or Diversity IN SOCIOLOGY.pptx
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parents
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
 

linked list

  • 1. Dgroup@mca.com ************ Presentation ON BY D Group
  • 2. Member of D group Privanka Dabhai Insert at first in single linked list Praful Aparnathi Insert at Last in single linked list Arpan Shah Insert at Order in single linked list Narendra Chauhan Delete in single linked list Ram Sanjay Copy in single linked list Rushabh Bhavsar MCQ Bhavisha Purohit
  • 3. Index Of Linear Linked List INDEX 1.Introduction 2.Algorithms 3.MCQ
  • 4. Introduction Of Linked List Introduction Of Linked List This subsection describes in detail the representation of linear lists using linked allocation. Algorithms such as the insertion of nodes and the deletion of nodes from a linked linear list are given. The programming aspects of linked allocation are discussed both from the simulation point of view, using arrays, and from the programmer defined data type facility available in pascal.
  • 5. Introduction Of Linked List Introduction Of Linked List The first approach is the one which is usually taken in programming linked represented structures in languages that do not have pointer or link facilities, such as FORTRAN,ALGOL 60 and BASIC, while the second approach is used in languages that do have pointer facilities, such as Pascal, PL/ISNOBOL,ALGOL 68 and ALGOL W.
  • 6. Introduction Of Linked List Introduction Of Linked List info Link
  • 7. Introduction Of Linked List Introduction Of Linked List The pointer variable AVAIL contains the address of the top node in the stack. The address of the next available node is to be stored in the variable NEW. If a node is available then the new top most element of the stack is denoted by LINK(AVAIL). The fields of the node corresponding to the pointer value of NEW can now be filled in and the field LINK(NEW) is set to a value which designates the successor node of this new node.
  • 8. Introduction Of Linked List A similar procedure can be formulated for the return of a discarded node to the availability stack. If the address of this discarded node is given by the variable FREE, then the link field of this node is set to the present value of AVAIL and the value of FREE becomes the new value of AVAIL. We can now formulate an algorithm which inserts a node into a linked linear list in a stack like manner.
  • 9. Algorithms of Linked List Algorithms → Insert at first in single linked list → Insert at Last in single linked list → Insert at Order in single linked list → Delete in single linked list → Copy in single linked list
  • 10. Insert at first in single linked Insert at first in single linked list INSERT(X,FIRST) Where X is a new element and FIRST, a pointer to the first element of a linked linear list whose typical node contains INFO and LINK fields as previously described, this function insert X. AVAIL is a pointer to the top element of the availability stack; NEW is a temporary pointer variable. It is required that X precede the node whose address is given to the FIRST.
  • 11. INSERT(X,FIRST) linked list Insert at first in single linked list Step 1: [Underflow?] if AVAIL= NULL Then write (“Availability stack underflow”) return (FIRST) Step 2: [Obtain address of next free node] NEW ←AVAIL Step 3: [Remove free node from availability node] AVAIL ← Step 4: [Initialize fields node from availability LINK(AVAIL) stack] INFO(NEW) ← X LINK(NEW) ← FIRST Step 5: [Return address of new node] Return(NEW)
  • 12. INSERT_LAST(X,FIRST) Insert at Last in single linked list INSERT_LAST(X,FIRST) Where X is a new element and FIRST, a pointer to the first element of a linked linear list whose typical node contains INFO and LINK fields as previously described, this function insert X. AVAIL is a pointer to the top element of the availability stack; NEW & SAVE are temporary pointer variable. It is required that X be inserted at the end of the list.
  • 13. INSERT_LAST(X,FIRST) Insert at Last in single linked list Step 1: [Underflow?] if AVAIL= NULL then write (“Availability stack underflow”) return (FIRST) Step 2: [Obtain address of next free node] NEW ← AVAIL Step 3: [Remove free node from availability node] AVAIL ← LINK(AVAIL) Step 4: [Initialize fields node from availability stack] INFO(NEW) ← X LINK(NEW) ← NULL
  • 14. INSERT_LAST(X,FIRST) Insert at Last in single linked list Step 5: [Is the list EMPTY?] if FIRST= NULL then Return(NEW) Step 6: [Initiate search for the last node] SAVE ← FIRST Step 7 : [Search for end of list] Repeat while LINK(SAVE) ≠ NULL SAVE ← LINK(SAVE) Step 8 : [Set LINK Field of last node to NEW] LINK(SAVE) ← NEW Step 9: [Return first node] Return(FIRST)
  • 15. INSERT_ORD(X,FIRST) Insert at Order in single linked list INSERT_ORD(X,FIRST) Where X is a new element and FIRST, a pointer to the first element of a linked linear list whose typical node contains INFO and LINK fields as previously described, AVAIL is a pointer to the top element of the availability stack; NEW & SAVE are temporary pointer variable. It is required that X be inserted so that it preserves the ordering of the terms in increasing order of their INFO fields.
  • 16. INSERT_ORD(X,FIRST) Insert at Order in single linked list Step 1: [Underflow?] if AVAIL= NULL then write (“Availability stack underflow”) return (FIRST) Step 2: [Obtain address of next free node] NEW ← AVAIL Step 3: [Remove free node from availability node] AVAIL ← LINK(AVAIL) Step 4: [Copy information contents into new node] INFO(NEW) ← X Step 5: [Is the list EMPTY?] if FIRST= NULL then Return(NEW)
  • 17. INSERT_ORD(X,FIRST) Insert at Order in single linked list Step 6: [Does the new node precede all others in the list?] if INFO(NEW) ≤ INFO(FIRST) then LINK(NEW) ← FIRST Return(NEW) Step 7 : [Initialize temporary pointer] SAVE ← FIRST Step 8 : [Search for predecessor of new node] Repeat while LINK(SAVE) ≠ NULL and INFO(LINK(SAVE)) ≤ INFO (NEW) SAVE ← LINK(SAVE) Step 9 : [Set LINK Field of new node and its predecessor] LINK(NEW) ← LINK(SAVE) LINK(SAVE) ← NEW Step 10: [Return first node] Return(FIRST)
  • 18. DELETE(X,FIRST) Delete in single linked list Where X and FIRST, pointer Variable whose values denote the address of a node in linked list and the address of the first node in the linked list, respectively, this procedure deletes the node whose address is given by X. TEMP is used to find the desired node, and PRED keeps track of the predecessor of TEMP. note that FIRST is changed only when X is the first elements of the list.
  • 19. DELETE(X,FIRST) Delete in single linked list Step 1: [EMPTY LIST?] if FIRST= NULL then write (“Underflow”) return Step 2: [Initialize search for X] TEMP ← FIRST Step 3: [Find X] Repeat thru Step 5 while TEMP ≠ x and LINK(TEMP) ≠ NULL Step 4: [Update Predecessor Marker ] PRED ← TEMP Step 5: [Move to next node] TEMP ← LINK(TEMP)
  • 20. DELETE(X,FIRST) Delete in single linked list Step 6: [End of the list?] if TEMP ≠ X then write(„NODE NOT FOUND”) return Step 7: [Delete X] if X = FIRST (is X the First NODE?) then FIRST ← LINK(FIRST) else LINK(PRED) ← LINK(X) Step 8 : [Return node to availability area] LINK(X) ← AVAIL AVAIL ← X return
  • 21. COPY(FIRST) Copy in single linked list Given FIRST, a pointer to the first node in the linked list, this function makes a copy of this list. A typical node in the given list consists of INFO and LINK fields. The new list is to contain nodes whose information and pointer fields are denoted by FIELD and PTR, respectively. The address of the first node in the newly created list is to be placed in BEGIN. NEW,SAVE and PRED are pointer variable.
  • 22. COPY(FIRST) Copy in single linked list Step 1: [EMPTY LIST?] if FIRST= NULL then write (“Underflow”) return Step 2: [Copy first node] if AVAIL = NULL then write(„Availability Stack UNDERFLOW‟) return(0) else NEW ← AVAIL AVAIL ← LINK(AVAIL) FIELD(NEW) ← INFO(FIRST) BEGIN ← NEW Step 3: [Initialize traversal] SAVE ← FIRST
  • 23. COPY(FIRST) Copy in single linked list Step 4: [Move to next node if not at the end of list] Repeat through step 6 while LINK(SAVE) ≠ NULL Step 5: [Update Predecessor and save pointers ] PRED ← NEW SAVE ← LINK(SAVE) Step 6: [Copy Node] if AVAIL = NULL then write(„Availability Stack UNDERFLOW‟) return(0) else NEW ← AVAIL AVAIL ← LINK(AVAIL) FIELD(NEW) ← INFO(SAVE) PTR(PRED) ← NEW
  • 24. COPY(FIRST) Copy in single linked list Step 7 : [Set Link of last node and return] PTR(NEW) ← NULL Return NULL return
  • 26. Linear Linked List MCQ PPT 1)A linear Structure in which the individual elements are joined together by references to other elements in the structure is known as a_________ •Tree (b) Vector (c) Linked list (d) Table 2)A list that restricts insertions and removals to the front ( or top ) is known as a (b) Linked list (b) stack (c) queue (d) frontal List 3)To Access an item in a singly linked list you must usa a _______ algorithm. (b) Traversal (b) access (c) removal (d) insertion 4)Linked lists are collections of data items “lined up in row”-insertions and deletion can be made only at the front and the back of a linked list. (b) TRUE (b) FALSE 5)Self-referential objects can be linked together to from useful data structures such as lists,queues,stacks and tree (a) TRUE (b) FALSE
  • 27. Linear Linked List MCQ PPT 6)The situation when in a linked list START=NULL is (a) Underflow (b) overflow (c) housefull (d) saturated 7)The link field in the last node of the linked list contains (a) NULL (b) link to the first node (c) pointer to the next element (d) Zero value 8)To delete a node at the beginning of the list, the location of the list is modified as the address of the. (a) Second element in the list (b)First element in the list (c) Last element in the list. 9) In the linked list representation of the stacks, the top of the stack is represented by (a)The last node (b) Any of the nodes (c) First node 10) A linked list in which the last node points to the first is called a (a) Doubly linked list (b) Circular list (c) Generalized list