SlideShare a Scribd company logo
1 of 10
ِ‫ن‬َ‫م‬ْ‫ح‬‫ه‬‫الر‬ ِ ‫ه‬
‫اَّلل‬ ِ‫م‬ْ‫س‬ِ‫ب‬
‫يم‬ ِ‫ح‬‫ه‬‫الر‬
LECTURE NO.2
By: Azhar Iqbal
Data Structures
& Algorithms
DATA STRUCTURE
Data Structure can be defined as the group of data elements which
provides an efficient way of storing and organizing data in the
computer so that it can be used efficiently.
Algorithm
Algorithm is a step-by-step procedure, which defines a set of instructions to be
executed in a certain order to get the desired output or to solve a particular
problem.. An algorithm can be implemented in more than one programming
language.
Learning data structures and algorithms allow us to write efficient and
optimized computer programs.
SOME DATA STRUCTURE ALGORITHMS
Searching: Algorithm to search an item in a data structure.
• Linear Search
• Binary Search
Sorting: Algorithm to sort items in a certain order.
• Selection Sort
• Bubble Sort
• Merge Sort
Insert: Algorithm to insert item in a data structure.
Update: Algorithm to update an existing item in a data structure.
Delete: Algorithm to delete an existing item from a data structure
Linear Data Structure
A Linear data structure have data elements arranged in sequential manner and
each member element is connected to its previous and next element. Such data
structures are easy to implement as computer memory is also sequential.
Examples of linear data structures are:
 Array
 Linked List
 Queue
 Stack
Array:
An array consists of data elements of a same data type. For example, if we want to store the roll
numbers of 5 students, so instead of creating 10 integer type variables, we will create an array
having size 5. Therefore, we can say that an array saves a lot of memory and reduces the length of
the code.
Let's discuss each linear data structure in detail.
Int array [ 5 ] = { 2 ,4 , 7 , 9 , 10 };
Stack:
It is linear data structure that uses the LIFO (Last In-
First Out) rule in which the data added last will be
removed first. The addition of data element in a
stack is known as a push operation, and the
deletion of data element form the list is known as
pop operation.
Queue:
It is a data structure that uses the FIFO
rule (First In-First Out). In this rule, the
element which is added first will be
removed first. There are two terms used
in the queue front end and rear The
insertion operation performed at the
back end is known as enqueue, and the
deletion operation performed at the
end is known as dequeue.
Linked list:
It is a collection of nodes that are made up of two parts, i.e., data element and reference to
next node in the sequence.
NON-LINEAR DATA STRUCTURE
Non-linear Data Structure: Data structures where data elements are not arranged
sequentially or linearly are called non-linear data structures.
Examples of non-linear data structures are:
 Tree
 BST (Binary Search Tree)
 Graphs
Continued . . . . . .

More Related Content

What's hot

introduction to Data Structure and classification
 introduction to Data Structure and classification introduction to Data Structure and classification
introduction to Data Structure and classificationchauhankapil
 
Introduction To Data Structures.
Introduction To Data Structures.Introduction To Data Structures.
Introduction To Data Structures.Education Front
 
Data structures and Alogarithims
Data structures and AlogarithimsData structures and Alogarithims
Data structures and AlogarithimsVictor Palmar
 
Lecture 1 data structures and algorithms
Lecture 1 data structures and algorithmsLecture 1 data structures and algorithms
Lecture 1 data structures and algorithmsAakash deep Singhal
 
Introduction to data structures (ss)
Introduction to data structures (ss)Introduction to data structures (ss)
Introduction to data structures (ss)Madishetty Prathibha
 
Introduction to data structure
Introduction to data structureIntroduction to data structure
Introduction to data structureadeel hamid
 
Over view of data structures
Over view of data structuresOver view of data structures
Over view of data structuresNagajothiN1
 
Introduction to data structure
Introduction to data structureIntroduction to data structure
Introduction to data structuresunilchute1
 
Mca ii dfs u-1 introduction to data structure
Mca ii dfs u-1 introduction to data structureMca ii dfs u-1 introduction to data structure
Mca ii dfs u-1 introduction to data structureRai University
 
Data Structure - Elementary Data Organization
Data Structure - Elementary  Data Organization Data Structure - Elementary  Data Organization
Data Structure - Elementary Data Organization Uma mohan
 
Abstract data types (adt) intro to data structure part 2
Abstract data types (adt)   intro to data structure part 2Abstract data types (adt)   intro to data structure part 2
Abstract data types (adt) intro to data structure part 2Self-Employed
 
Introduction to data structure
Introduction to data structureIntroduction to data structure
Introduction to data structureVivek Kumar Sinha
 
Chapter 1( intro & overview)
Chapter 1( intro & overview)Chapter 1( intro & overview)
Chapter 1( intro & overview)MUHAMMAD AAMIR
 

What's hot (20)

Lecture 1
Lecture 1Lecture 1
Lecture 1
 
Data structure
Data  structureData  structure
Data structure
 
introduction to Data Structure and classification
 introduction to Data Structure and classification introduction to Data Structure and classification
introduction to Data Structure and classification
 
Introduction To Data Structures.
Introduction To Data Structures.Introduction To Data Structures.
Introduction To Data Structures.
 
Data structure
Data structureData structure
Data structure
 
Data structures and Alogarithims
Data structures and AlogarithimsData structures and Alogarithims
Data structures and Alogarithims
 
Lecture 1 data structures and algorithms
Lecture 1 data structures and algorithmsLecture 1 data structures and algorithms
Lecture 1 data structures and algorithms
 
Introduction to data structures (ss)
Introduction to data structures (ss)Introduction to data structures (ss)
Introduction to data structures (ss)
 
Introduction to data structure
Introduction to data structureIntroduction to data structure
Introduction to data structure
 
Over view of data structures
Over view of data structuresOver view of data structures
Over view of data structures
 
Introduction to data structure
Introduction to data structureIntroduction to data structure
Introduction to data structure
 
Mca ii dfs u-1 introduction to data structure
Mca ii dfs u-1 introduction to data structureMca ii dfs u-1 introduction to data structure
Mca ii dfs u-1 introduction to data structure
 
Data Structure - Elementary Data Organization
Data Structure - Elementary  Data Organization Data Structure - Elementary  Data Organization
Data Structure - Elementary Data Organization
 
Data structure and its types.
Data structure and its types.Data structure and its types.
Data structure and its types.
 
Abstract data types (adt) intro to data structure part 2
Abstract data types (adt)   intro to data structure part 2Abstract data types (adt)   intro to data structure part 2
Abstract data types (adt) intro to data structure part 2
 
Introduction to data structure
Introduction to data structureIntroduction to data structure
Introduction to data structure
 
Computer Science-Data Structures :Abstract DataType (ADT)
Computer Science-Data Structures :Abstract DataType (ADT)Computer Science-Data Structures :Abstract DataType (ADT)
Computer Science-Data Structures :Abstract DataType (ADT)
 
Intro ds
Intro dsIntro ds
Intro ds
 
Lecture1 data structure(introduction)
Lecture1 data structure(introduction)Lecture1 data structure(introduction)
Lecture1 data structure(introduction)
 
Chapter 1( intro & overview)
Chapter 1( intro & overview)Chapter 1( intro & overview)
Chapter 1( intro & overview)
 

Similar to Data Structures and Algorithms Lecture

DS Module 1.pptx
DS Module 1.pptxDS Module 1.pptx
DS Module 1.pptxSaralaT3
 
Data Structure
Data Structure Data Structure
Data Structure Ibrahim MH
 
DS Module 1.pptx
DS Module 1.pptxDS Module 1.pptx
DS Module 1.pptxsarala9
 
DATA STRUCTURE AND ALGORITHMS
DATA STRUCTURE AND ALGORITHMS DATA STRUCTURE AND ALGORITHMS
DATA STRUCTURE AND ALGORITHMS Adams Sidibe
 
Data Structures and algoithms Unit - 1.pptx
Data Structures and algoithms Unit - 1.pptxData Structures and algoithms Unit - 1.pptx
Data Structures and algoithms Unit - 1.pptxmexiuro901
 
Chapter 1 Introduction to Data Structures and Algorithms.pdf
Chapter 1 Introduction to Data Structures and Algorithms.pdfChapter 1 Introduction to Data Structures and Algorithms.pdf
Chapter 1 Introduction to Data Structures and Algorithms.pdfAxmedcarb
 
Which data structure is it? What are the various data structure kinds and wha...
Which data structure is it? What are the various data structure kinds and wha...Which data structure is it? What are the various data structure kinds and wha...
Which data structure is it? What are the various data structure kinds and wha...Tutort Academy
 
Data structures - Introduction
Data structures - IntroductionData structures - Introduction
Data structures - IntroductionDeepaThirumurugan
 
introduction about data structure_i.pptx
introduction about data structure_i.pptxintroduction about data structure_i.pptx
introduction about data structure_i.pptxpoonamsngr
 
DATA STRUCTURES USING C -ENGGDIGEST
DATA STRUCTURES USING C -ENGGDIGESTDATA STRUCTURES USING C -ENGGDIGEST
DATA STRUCTURES USING C -ENGGDIGESTSwapnil Mishra
 
CHAPTER-1- Introduction to data structure.pptx
CHAPTER-1- Introduction to data structure.pptxCHAPTER-1- Introduction to data structure.pptx
CHAPTER-1- Introduction to data structure.pptxOnkarModhave
 
Unit.1 Introduction to Data Structuresres
Unit.1 Introduction to Data StructuresresUnit.1 Introduction to Data Structuresres
Unit.1 Introduction to Data Structuresresamplopsurat
 
DS Complete notes for Computer science and Engineering
DS Complete notes for Computer science and EngineeringDS Complete notes for Computer science and Engineering
DS Complete notes for Computer science and EngineeringRAJASEKHARV8
 
Algorithms.pptx
Algorithms.pptxAlgorithms.pptx
Algorithms.pptxjohn6938
 
DataStructurePpt.pptx
DataStructurePpt.pptxDataStructurePpt.pptx
DataStructurePpt.pptxssuser031f35
 

Similar to Data Structures and Algorithms Lecture (20)

DS Module 1.pptx
DS Module 1.pptxDS Module 1.pptx
DS Module 1.pptx
 
Data Structure
Data Structure Data Structure
Data Structure
 
DS Module 1.pptx
DS Module 1.pptxDS Module 1.pptx
DS Module 1.pptx
 
DATA STRUCTURE AND ALGORITHMS
DATA STRUCTURE AND ALGORITHMS DATA STRUCTURE AND ALGORITHMS
DATA STRUCTURE AND ALGORITHMS
 
Data Structures and algoithms Unit - 1.pptx
Data Structures and algoithms Unit - 1.pptxData Structures and algoithms Unit - 1.pptx
Data Structures and algoithms Unit - 1.pptx
 
Chapter 1 Introduction to Data Structures and Algorithms.pdf
Chapter 1 Introduction to Data Structures and Algorithms.pdfChapter 1 Introduction to Data Structures and Algorithms.pdf
Chapter 1 Introduction to Data Structures and Algorithms.pdf
 
Which data structure is it? What are the various data structure kinds and wha...
Which data structure is it? What are the various data structure kinds and wha...Which data structure is it? What are the various data structure kinds and wha...
Which data structure is it? What are the various data structure kinds and wha...
 
CSE 443 (1).pptx
CSE 443 (1).pptxCSE 443 (1).pptx
CSE 443 (1).pptx
 
TSAT Presentation1.pptx
TSAT Presentation1.pptxTSAT Presentation1.pptx
TSAT Presentation1.pptx
 
Data structures - Introduction
Data structures - IntroductionData structures - Introduction
Data structures - Introduction
 
introduction about data structure_i.pptx
introduction about data structure_i.pptxintroduction about data structure_i.pptx
introduction about data structure_i.pptx
 
DATA STRUCTURES USING C -ENGGDIGEST
DATA STRUCTURES USING C -ENGGDIGESTDATA STRUCTURES USING C -ENGGDIGEST
DATA STRUCTURES USING C -ENGGDIGEST
 
CHAPTER-1- Introduction to data structure.pptx
CHAPTER-1- Introduction to data structure.pptxCHAPTER-1- Introduction to data structure.pptx
CHAPTER-1- Introduction to data structure.pptx
 
Ch1
Ch1Ch1
Ch1
 
DSA - Copy.pptx
DSA - Copy.pptxDSA - Copy.pptx
DSA - Copy.pptx
 
Unit.1 Introduction to Data Structuresres
Unit.1 Introduction to Data StructuresresUnit.1 Introduction to Data Structuresres
Unit.1 Introduction to Data Structuresres
 
DS Complete notes for Computer science and Engineering
DS Complete notes for Computer science and EngineeringDS Complete notes for Computer science and Engineering
DS Complete notes for Computer science and Engineering
 
Algorithms.pptx
Algorithms.pptxAlgorithms.pptx
Algorithms.pptx
 
Chapter 1
Chapter 1Chapter 1
Chapter 1
 
DataStructurePpt.pptx
DataStructurePpt.pptxDataStructurePpt.pptx
DataStructurePpt.pptx
 

Recently uploaded

Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfSpandanaRallapalli
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for BeginnersSabitha Banu
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
Quarter 4 Peace-education.pptx Catch Up Friday
Quarter 4 Peace-education.pptx Catch Up FridayQuarter 4 Peace-education.pptx Catch Up Friday
Quarter 4 Peace-education.pptx Catch Up FridayMakMakNepo
 
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
 
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
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxRaymartEstabillo3
 
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxGrade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxChelloAnnAsuncion2
 
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
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Mark Reed
 
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
 
ROOT CAUSE ANALYSIS PowerPoint Presentation
ROOT CAUSE ANALYSIS PowerPoint PresentationROOT CAUSE ANALYSIS PowerPoint Presentation
ROOT CAUSE ANALYSIS PowerPoint PresentationAadityaSharma884161
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 
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
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
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
 

Recently uploaded (20)

Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdf
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for Beginners
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
Quarter 4 Peace-education.pptx Catch Up Friday
Quarter 4 Peace-education.pptx Catch Up FridayQuarter 4 Peace-education.pptx Catch Up Friday
Quarter 4 Peace-education.pptx Catch Up Friday
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
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
 
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...
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
 
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxGrade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
 
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
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)
 
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
 
ROOT CAUSE ANALYSIS PowerPoint Presentation
ROOT CAUSE ANALYSIS PowerPoint PresentationROOT CAUSE ANALYSIS PowerPoint Presentation
ROOT CAUSE ANALYSIS PowerPoint Presentation
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 
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 🔝✔️✔️
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
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
 

Data Structures and Algorithms Lecture

  • 1. ِ‫ن‬َ‫م‬ْ‫ح‬‫ه‬‫الر‬ ِ ‫ه‬ ‫اَّلل‬ ِ‫م‬ْ‫س‬ِ‫ب‬ ‫يم‬ ِ‫ح‬‫ه‬‫الر‬
  • 2. LECTURE NO.2 By: Azhar Iqbal Data Structures & Algorithms
  • 3. DATA STRUCTURE Data Structure can be defined as the group of data elements which provides an efficient way of storing and organizing data in the computer so that it can be used efficiently. Algorithm Algorithm is a step-by-step procedure, which defines a set of instructions to be executed in a certain order to get the desired output or to solve a particular problem.. An algorithm can be implemented in more than one programming language. Learning data structures and algorithms allow us to write efficient and optimized computer programs.
  • 4. SOME DATA STRUCTURE ALGORITHMS Searching: Algorithm to search an item in a data structure. • Linear Search • Binary Search Sorting: Algorithm to sort items in a certain order. • Selection Sort • Bubble Sort • Merge Sort Insert: Algorithm to insert item in a data structure. Update: Algorithm to update an existing item in a data structure. Delete: Algorithm to delete an existing item from a data structure
  • 5. Linear Data Structure A Linear data structure have data elements arranged in sequential manner and each member element is connected to its previous and next element. Such data structures are easy to implement as computer memory is also sequential. Examples of linear data structures are:  Array  Linked List  Queue  Stack
  • 6. Array: An array consists of data elements of a same data type. For example, if we want to store the roll numbers of 5 students, so instead of creating 10 integer type variables, we will create an array having size 5. Therefore, we can say that an array saves a lot of memory and reduces the length of the code. Let's discuss each linear data structure in detail. Int array [ 5 ] = { 2 ,4 , 7 , 9 , 10 }; Stack: It is linear data structure that uses the LIFO (Last In- First Out) rule in which the data added last will be removed first. The addition of data element in a stack is known as a push operation, and the deletion of data element form the list is known as pop operation.
  • 7. Queue: It is a data structure that uses the FIFO rule (First In-First Out). In this rule, the element which is added first will be removed first. There are two terms used in the queue front end and rear The insertion operation performed at the back end is known as enqueue, and the deletion operation performed at the end is known as dequeue.
  • 8. Linked list: It is a collection of nodes that are made up of two parts, i.e., data element and reference to next node in the sequence.
  • 9. NON-LINEAR DATA STRUCTURE Non-linear Data Structure: Data structures where data elements are not arranged sequentially or linearly are called non-linear data structures. Examples of non-linear data structures are:  Tree  BST (Binary Search Tree)  Graphs
  • 10. Continued . . . . . .