SlideShare ist ein Scribd-Unternehmen logo
1 von 56
 
 
List data structure ,[object Object],[object Object],[object Object],[object Object],[object Object]
List data structure ,[object Object],[object Object]
Operations a programmer performs with a list data structure. Operation Name Description createList() Create a new list (presumably empty) copy() Set one list to be a copy of another clear();  Clear a list (remove all elements) insert(X, ?) Insert element X at a  particular position  in the list remove(?) Remove element at some position in the list get(?) Get element at a given position update(X, ?) Replace the element at a given position with X find(X) Determine if the element X is in the list length() Returns the length of the list.
List Data Structure ,[object Object],[object Object],[object Object],[object Object],[object Object]
List Data Structure ,[object Object],Functions Description start() Moves the “current” pointer to the very first element tail() Moves the “current” pointer to the very last element next() Move the current position forward one element back() Move the current position backward one element
List Implementation ,[object Object],[object Object],[object Object],A  2 6 8 7 1 current size Index 1 2 3 4 5 3 5
add Method ,[object Object],[object Object],[object Object],[object Object],[object Object],A  2 6 8 7 1 current size Index 1 2 3 4 5 4 5 A  2 6 8 9 7 1 current size Index 1 2 3 4 5 6 4 6
next Method ,[object Object],[object Object],[object Object]
remove Method ,[object Object],[object Object],[object Object],A  2 6 8 9 1 current size Index 1 2 3 4 5 6 5 6 5 A  2 6 8 9 1 current size Index 1 2 3 4 5 5 5
find Method ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Other Methods ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Analysis of Array List ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
 
List using Linked Memory ,[object Object],[object Object],[object Object],[object Object]
For the utilization of the concept of linked memory, we usually define a structure, called linked list.
Linked Lists ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object], Head data pointer node A B C A
Linked List ,[object Object],[object Object],[object Object],Head  Current 2 6 1 7 8
Representation of Link List in Computer Memory
Inserting a new node ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Inserting to the Front ,[object Object],[object Object],[object Object],[object Object],head 48 17 142 head 93
Inserting to the End ,[object Object],[object Object],[object Object],[object Object],[object Object],48 17 142 head // 93 //
Inserting to the Middle ,[object Object],[object Object],[object Object],[object Object],[object Object],17 48 142 head // 93 // 142
Searching a Linked List ,[object Object],[object Object]
Deleting a node ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
The Scenario 4 17 head 4 17 head 4 17 head 4 17 head 42 6 42 6 42 42
Traversing a Link List ,[object Object],[object Object],[object Object],[object Object]
Link List in C# ,[object Object],[object Object],[object Object],[object Object]
AN OBJECT-ORIENTED LINKED LIST DESIGN ,[object Object],[object Object],[object Object],[object Object]
The Node Class ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
The LinkedList Class ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Insert Method ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Remove Method ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
PrintList Method ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Analysis of Link List ,[object Object],[object Object],[object Object]
Analysis of Link List ,[object Object],[object Object],[object Object],[object Object],[object Object]
Variations of Linked Lists ,[object Object],[object Object],[object Object],[object Object],Head   A B C
Variations of Linked Lists ,[object Object],[object Object],[object Object],Head A B C
Josephus Problem ,[object Object],2 3 4 5 6 7 8 9 10 N=10, M=3 4 5 6 7 8 9 10 1 2 3 Eliminated
Josephus Problem ,[object Object],[object Object],[object Object]
Array versus Linked Lists ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
What is a Priority Queues? ,[object Object],[object Object],[object Object],[object Object]
What’s so different? ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Priority Queue ,[object Object]
Continue…. ,[object Object],[object Object],[object Object],[object Object]
Why Priority Queue ? ,[object Object],[object Object],[object Object],[object Object],[object Object]
The Concept of Key ,[object Object],Course Priority Due Date Database Management System 3 26 th -December-2009 Data Structure And Algorithm 1 26 th -November-2009 Computer Architecture And Organization 2 6 th -December-2009
Representation of Priority Queue  ,[object Object],[object Object],[object Object],[object Object]
One-Way List Representation of a Priority Queue ,[object Object],[object Object],[object Object],[object Object]
Array Representation of Priority Queue ,[object Object],[object Object],[object Object]
Linked List based Implementation of Priority Queue
Continue….
Implementation of Operation
Continue….
Continue….

Weitere ähnliche Inhalte

Was ist angesagt?

Was ist angesagt? (20)

Linked List
Linked ListLinked List
Linked List
 
Array in c#
Array in c#Array in c#
Array in c#
 
Lecture 1
Lecture 1Lecture 1
Lecture 1
 
ADO .Net
ADO .Net ADO .Net
ADO .Net
 
Simple xml in .net
Simple xml in .netSimple xml in .net
Simple xml in .net
 
Linked List
Linked ListLinked List
Linked List
 
Css Ppt
Css PptCss Ppt
Css Ppt
 
Java Collection framework
Java Collection frameworkJava Collection framework
Java Collection framework
 
JavaScript - Chapter 7 - Advanced Functions
 JavaScript - Chapter 7 - Advanced Functions JavaScript - Chapter 7 - Advanced Functions
JavaScript - Chapter 7 - Advanced Functions
 
Xml
XmlXml
Xml
 
Data structure power point presentation
Data structure power point presentation Data structure power point presentation
Data structure power point presentation
 
Classes and Objects
Classes and Objects  Classes and Objects
Classes and Objects
 
Introduction to data structure ppt
Introduction to data structure pptIntroduction to data structure ppt
Introduction to data structure ppt
 
Data Structures (CS8391)
Data Structures (CS8391)Data Structures (CS8391)
Data Structures (CS8391)
 
joins and subqueries in big data analysis
joins and subqueries in big data analysisjoins and subqueries in big data analysis
joins and subqueries in big data analysis
 
Linked list
Linked listLinked list
Linked list
 
standard template library(STL) in C++
standard template library(STL) in C++standard template library(STL) in C++
standard template library(STL) in C++
 
LINKED LISTS
LINKED LISTSLINKED LISTS
LINKED LISTS
 
Data Structures - Lecture 7 [Linked List]
Data Structures - Lecture 7 [Linked List]Data Structures - Lecture 7 [Linked List]
Data Structures - Lecture 7 [Linked List]
 
Event handling
Event handlingEvent handling
Event handling
 

Andere mochten auch

Andere mochten auch (20)

Linked list
Linked listLinked list
Linked list
 
Linked lists
Linked listsLinked lists
Linked lists
 
Single linked list
Single linked listSingle linked list
Single 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
linked list linked list
linked list
 
Link List
Link ListLink List
Link List
 
Introduction to data structures and Algorithm
Introduction to data structures and AlgorithmIntroduction to data structures and Algorithm
Introduction to data structures and Algorithm
 
DATA STRUCTURES
DATA STRUCTURESDATA STRUCTURES
DATA STRUCTURES
 
Python Spell Checker
Python Spell CheckerPython Spell Checker
Python Spell Checker
 
General Solution for Josephus Problem
General Solution for Josephus ProblemGeneral Solution for Josephus Problem
General Solution for Josephus Problem
 
Computer notes - Josephus Problem
Computer notes - Josephus ProblemComputer notes - Josephus Problem
Computer notes - Josephus Problem
 
Lec5
Lec5Lec5
Lec5
 
Doubly Linked List || Operations || Algorithms
Doubly Linked List || Operations || AlgorithmsDoubly Linked List || Operations || Algorithms
Doubly Linked List || Operations || Algorithms
 
Heaps
HeapsHeaps
Heaps
 
Stacks,queues,linked-list
Stacks,queues,linked-listStacks,queues,linked-list
Stacks,queues,linked-list
 
Lecture1 data structure(introduction)
Lecture1 data structure(introduction)Lecture1 data structure(introduction)
Lecture1 data structure(introduction)
 
BSc I year practicals
BSc I year practicalsBSc I year practicals
BSc I year practicals
 
Abstract Data Types
Abstract Data TypesAbstract Data Types
Abstract Data Types
 
Data structures / C++ Program examples
Data structures / C++ Program examplesData structures / C++ Program examples
Data structures / C++ Program examples
 
Linked list
Linked listLinked list
Linked list
 

Ähnlich wie linked list (c#)

computer notes - List implementation
computer notes - List implementationcomputer notes - List implementation
computer notes - List implementationecomputernotes
 
List Data Structure
List Data StructureList Data Structure
List Data StructureZidny Nafan
 
Data Structures Design Notes.pdf
Data Structures Design Notes.pdfData Structures Design Notes.pdf
Data Structures Design Notes.pdfAmuthachenthiruK
 
unit-ids17-180709051413-1.pdf
unit-ids17-180709051413-1.pdfunit-ids17-180709051413-1.pdf
unit-ids17-180709051413-1.pdfKarthiKeyan326587
 
MODULE 5-Searching and-sorting
MODULE 5-Searching and-sortingMODULE 5-Searching and-sorting
MODULE 5-Searching and-sortingnikshaikh786
 
unit 5 stack & queue.ppt
unit 5 stack & queue.pptunit 5 stack & queue.ppt
unit 5 stack & queue.pptSeethaDinesh
 
introduction_dst.pptx
introduction_dst.pptxintroduction_dst.pptx
introduction_dst.pptxHammadTariq51
 
computer notes - Stack
computer notes - Stackcomputer notes - Stack
computer notes - Stackecomputernotes
 
data structures and algorithms Unit 3
data structures and algorithms Unit 3data structures and algorithms Unit 3
data structures and algorithms Unit 3infanciaj
 
computer notes - Linked list
computer notes - Linked listcomputer notes - Linked list
computer notes - Linked listecomputernotes
 
Linked List Objective The purpose of this exercise is to cr.pdf
Linked List Objective The purpose of this exercise is to cr.pdfLinked List Objective The purpose of this exercise is to cr.pdf
Linked List Objective The purpose of this exercise is to cr.pdfadityacomputers001
 
Objective The purpose of this exercise is to create a Linke.pdf
Objective The purpose of this exercise is to create a Linke.pdfObjective The purpose of this exercise is to create a Linke.pdf
Objective The purpose of this exercise is to create a Linke.pdfadvancethchnologies
 
Objective The purpose of this exercise is to create a Linke.pdf
Objective The purpose of this exercise is to create a Linke.pdfObjective The purpose of this exercise is to create a Linke.pdf
Objective The purpose of this exercise is to create a Linke.pdfgiriraj65
 

Ähnlich wie linked list (c#) (20)

computer notes - List implementation
computer notes - List implementationcomputer notes - List implementation
computer notes - List implementation
 
Data Structure lec#2
Data Structure lec#2Data Structure lec#2
Data Structure lec#2
 
List data structure
List data structure List data structure
List data structure
 
List Data Structure
List Data StructureList Data Structure
List Data Structure
 
Data Structures Design Notes.pdf
Data Structures Design Notes.pdfData Structures Design Notes.pdf
Data Structures Design Notes.pdf
 
Data Structure
Data StructureData Structure
Data Structure
 
unit-ids17-180709051413-1.pdf
unit-ids17-180709051413-1.pdfunit-ids17-180709051413-1.pdf
unit-ids17-180709051413-1.pdf
 
MODULE 5-Searching and-sorting
MODULE 5-Searching and-sortingMODULE 5-Searching and-sorting
MODULE 5-Searching and-sorting
 
unit 5 stack & queue.ppt
unit 5 stack & queue.pptunit 5 stack & queue.ppt
unit 5 stack & queue.ppt
 
Lecture2
Lecture2Lecture2
Lecture2
 
introduction_dst.pptx
introduction_dst.pptxintroduction_dst.pptx
introduction_dst.pptx
 
computer notes - Stack
computer notes - Stackcomputer notes - Stack
computer notes - Stack
 
Ds notes
Ds notesDs notes
Ds notes
 
data structures and algorithms Unit 3
data structures and algorithms Unit 3data structures and algorithms Unit 3
data structures and algorithms Unit 3
 
General Data structures
General Data structuresGeneral Data structures
General Data structures
 
computer notes - Linked list
computer notes - Linked listcomputer notes - Linked list
computer notes - Linked list
 
Linked lists
Linked listsLinked lists
Linked lists
 
Linked List Objective The purpose of this exercise is to cr.pdf
Linked List Objective The purpose of this exercise is to cr.pdfLinked List Objective The purpose of this exercise is to cr.pdf
Linked List Objective The purpose of this exercise is to cr.pdf
 
Objective The purpose of this exercise is to create a Linke.pdf
Objective The purpose of this exercise is to create a Linke.pdfObjective The purpose of this exercise is to create a Linke.pdf
Objective The purpose of this exercise is to create a Linke.pdf
 
Objective The purpose of this exercise is to create a Linke.pdf
Objective The purpose of this exercise is to create a Linke.pdfObjective The purpose of this exercise is to create a Linke.pdf
Objective The purpose of this exercise is to create a Linke.pdf
 

Kürzlich hochgeladen

GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSGRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSJoshuaGantuangco2
 
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
 
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
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersSabitha Banu
 
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
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Celine George
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceSamikshaHamane
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxHumphrey A Beña
 
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
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 
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
 
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONHumphrey A Beña
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPCeline George
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfSpandanaRallapalli
 

Kürzlich hochgeladen (20)

GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSGRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
 
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_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptxYOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
 
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
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginners
 
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
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in Pharmacovigilance
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.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 🔝✔️✔️
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
 
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
 
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptxLEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
 
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptxFINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
 
OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.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
 
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERP
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdf
 

linked list (c#)

  • 1.  
  • 2.  
  • 3.
  • 4.
  • 5. Operations a programmer performs with a list data structure. Operation Name Description createList() Create a new list (presumably empty) copy() Set one list to be a copy of another clear(); Clear a list (remove all elements) insert(X, ?) Insert element X at a particular position in the list remove(?) Remove element at some position in the list get(?) Get element at a given position update(X, ?) Replace the element at a given position with X find(X) Determine if the element X is in the list length() Returns the length of the list.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.  
  • 16.
  • 17. For the utilization of the concept of linked memory, we usually define a structure, called linked list.
  • 18.
  • 19.
  • 20. Representation of Link List in Computer Memory
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.
  • 26.
  • 27. The Scenario 4 17 head 4 17 head 4 17 head 4 17 head 42 6 42 6 42 42
  • 28.
  • 29.
  • 30.
  • 31.
  • 32.
  • 33.
  • 34.
  • 35.
  • 36.
  • 37.
  • 38.
  • 39.
  • 40.
  • 41.
  • 42.
  • 43.
  • 44.
  • 45.
  • 46.
  • 47.
  • 48.
  • 49.
  • 50.
  • 51.
  • 52. Linked List based Implementation of Priority Queue

Hinweis der Redaktion

  1. In the above code, we execute a for loop to traverse the array. The number of execution of this loop is equal to the size of the list. This for loop gets terminated when the value of loop variable ( j ) increases from the size of the list. However we terminate the loop with the break statement if the element is found at a position. When the control comes out from the loop, we check the value of j . If the value of j is less than the size of the array, it means that the loop was terminated by the break statement. We use the break statement when we find the required element (x) in the list. The execution of break statement shows that the required element was found at the position equal to the value of j . So the program sets the current position to j and comes out the function by returning 1 (i.e. true). If the value of j is greater than the size of the array, it means that the whole array has traversed and the required element is not found. So we simply return 0 (i.e. false) and come out of the function.
  2. You may notice here that we are returning the size {in the length () }of the list and not the size of the array being used internally to implement the list. This size is the number of the elements of the list, stored in the array.
  3. Add example from pg: 115
  4. You don't need to use pointers to create a linked list in C#. Just store an object reference to the next list element.
  5. Fig: Pg 194