SlideShare a Scribd company logo
DATA STRUCTURES AND ALGORITHMS
DATA STRUCTURES AND ALGORITHMS - DEFINED
Data structure
 is an arrangement of data in a computer's memory or even disk storage.
Examples : Arrays, lists, sets, queues, stacks, binary trees, hash tables, and graphs.
Algorithms
 are used to manipulate the data contained in these data structures as in searching and sorting.
Many algorithms apply directly to a specific data structures. When working with certain data structures you need
to know how to insert new data, search for a specified item, and deleting a specific item.
DATA STRUCTURES AND ALGORITHMS - DEFINED
Commonly used algorithms include are useful for:
 Searching for a particular data item (or record).
 Sorting the data.
 Iterating through all the items in a data structure. (Visiting each item in turn so as to display it
or perform some other action on these items)
WHY DO WE NEED DATA STRUCTURES ?
 Data structure is a particular way of storing and organizing information in a
computer so that it can be retrieved and used most productively.
 Each Data Structure allows data to be stored in specific manner.
 Data Structure allows efficient data search and retrieval.
 Specific Data structures are decided to work for specific problems.
 It allows to manage large amount of data such as large databases and indexing services such
as hash table.
The choice of data structure and algorithm can make the difference between a program running in a few
seconds or many days.
HOW TO SELECT DATA STRUCTURE?
When selecting a data structure to solve a problem, you should follow these steps.
1. Analyze your problem to determine the basic operations that must be supported. Examples of
basic operations include inserting a data item into the data structure, deleting a data item from
the data structure, and finding a specified data item.
2. Quantify the resource constraints for each operation.
3. Select the data structure that best meets these requirements
Some questions to ask:
 Are all data inserted into the data structure at the beginning, or are insertions interspersed with other
operations?
 Can data be deleted?
 Are all data processed in some well-defined order, or is random access allowed?
DATA STRUCTURE PHILOSOPHY
1. Each data structure has costs and benefits.
2. Rarely is one data structure better than another in all situations.
3. A data structure requires:
 space for each data item it stores,
 time to perform each basic operation,
 programming effort.
4. Each problem has constraints on available space and time.
5. Only after a careful analysis of problem characteristics can we know the best
data structure for the task.
ABSTRACT DATA TYPES
 A type is a collection of values.
 A data type is a type together with a collection of operations to manipulate the type.
 A data item is a piece of information or a record whose value is drawn from a type. A data item is said to be a
member of a type.
 An abstract data type (ADT) is the specification of a data type within some language, independent of an
implementation.
 The interface for the ADT is defined in terms of a type and a set of operations on that type.
 The behavior of each operation is determined by its inputs and outputs.
 An ADT does not specify how the data type is implemented.
 These implementation details are hidden from the user of the ADT and protected from outside access, a concept referred to as encapsulation.
 A data structure is the implementation for an ADT.
 In an object-oriented language, an ADT and its implementation together make up a class.
 Each operation associated with the ADT is implemented by a member function or method.
 The variables that define the space required by a data item are referred to as data members.
 An object is an instance of a class, that is, something that is created and takes up storage during the execution of a computer program.
MOTIVATING QUOTATIONS
“Every program depends on algorithms and data
structures, but few programs depend on the invention of
brand new ones.”
-- Kernighan & Pike!
“I will, in fact, claim that the difference between a bad
programmer and a good one is whether he considers his
code or his data structures more important. Bad
programmers worry about the code. Good programmers
worry about data structures and their relationships.”
-- Linus Torvalds!
Ad

More Related Content

Similar to Lesson 1 - Data Structures and Algorithms Overview.pdf (20)

Introduction to data structure
Introduction to data structureIntroduction to data structure
Introduction to data structure
sunilchute1
 
Introduction to data structure
Introduction to data structureIntroduction to data structure
Introduction to data structure
sunilchute1
 
Data Structure Introduction.pdfssssssssssss
Data Structure Introduction.pdfssssssssssssData Structure Introduction.pdfssssssssssss
Data Structure Introduction.pdfssssssssssss
parwarsmko98
 
Unit.1 Introduction to Data Structuresres
Unit.1 Introduction to Data StructuresresUnit.1 Introduction to Data Structuresres
Unit.1 Introduction to Data Structuresres
amplopsurat
 
Data structure
Data structureData structure
Data structure
Prof. Dr. K. Adisesha
 
data structures and its importance
 data structures and its importance  data structures and its importance
data structures and its importance
Anaya Zafar
 
UNIT II.docx
UNIT II.docxUNIT II.docx
UNIT II.docx
Revathiparamanathan
 
Basic terminologies
Basic terminologiesBasic terminologies
Basic terminologies
Rajendran
 
Iare ds lecture_notes_2
Iare ds lecture_notes_2Iare ds lecture_notes_2
Iare ds lecture_notes_2
RajSingh734307
 
Big data analytics(BAD601) module-1 ppt
Big data analytics(BAD601)  module-1 pptBig data analytics(BAD601)  module-1 ppt
Big data analytics(BAD601) module-1 ppt
AmbikaVenkatesh4
 
Lecture 1. Data Structure & Algorithm.pptx
Lecture 1. Data Structure & Algorithm.pptxLecture 1. Data Structure & Algorithm.pptx
Lecture 1. Data Structure & Algorithm.pptx
ArifKamal36
 
Lecture_1_Introduction to Data Structures and Algorithm.pptx
Lecture_1_Introduction to Data Structures and Algorithm.pptxLecture_1_Introduction to Data Structures and Algorithm.pptx
Lecture_1_Introduction to Data Structures and Algorithm.pptx
mueedmughal88
 
DATA STRUCTURE AND ALGORITHMS
DATA STRUCTURE AND ALGORITHMS DATA STRUCTURE AND ALGORITHMS
DATA STRUCTURE AND ALGORITHMS
removed_8057d320f6c8601c14a895598b86eacb
 
Database Systems - introduction
Database Systems - introductionDatabase Systems - introduction
Database Systems - introduction
Jananath Banuka
 
UNIT I - Data Structures.pdf
UNIT I - Data Structures.pdfUNIT I - Data Structures.pdf
UNIT I - Data Structures.pdf
KPRevathiAsstprofITD
 
DSA(Lec-1,2,3) For C++ Introduction for basics
DSA(Lec-1,2,3) For C++ Introduction for basicsDSA(Lec-1,2,3) For C++ Introduction for basics
DSA(Lec-1,2,3) For C++ Introduction for basics
x28tjyi81j
 
Ch1
Ch1Ch1
Ch1
OmarFarukh3
 
Basic of Data Structure - Data Structure - Notes
Basic of Data Structure - Data Structure - NotesBasic of Data Structure - Data Structure - Notes
Basic of Data Structure - Data Structure - Notes
Omprakash Chauhan
 
Database Management System
Database Management SystemDatabase Management System
Database Management System
Nishant Munjal
 
database management system - overview of entire dbms
database management system - overview of entire dbmsdatabase management system - overview of entire dbms
database management system - overview of entire dbms
vikramkagitapu
 
Introduction to data structure
Introduction to data structureIntroduction to data structure
Introduction to data structure
sunilchute1
 
Introduction to data structure
Introduction to data structureIntroduction to data structure
Introduction to data structure
sunilchute1
 
Data Structure Introduction.pdfssssssssssss
Data Structure Introduction.pdfssssssssssssData Structure Introduction.pdfssssssssssss
Data Structure Introduction.pdfssssssssssss
parwarsmko98
 
Unit.1 Introduction to Data Structuresres
Unit.1 Introduction to Data StructuresresUnit.1 Introduction to Data Structuresres
Unit.1 Introduction to Data Structuresres
amplopsurat
 
data structures and its importance
 data structures and its importance  data structures and its importance
data structures and its importance
Anaya Zafar
 
Basic terminologies
Basic terminologiesBasic terminologies
Basic terminologies
Rajendran
 
Iare ds lecture_notes_2
Iare ds lecture_notes_2Iare ds lecture_notes_2
Iare ds lecture_notes_2
RajSingh734307
 
Big data analytics(BAD601) module-1 ppt
Big data analytics(BAD601)  module-1 pptBig data analytics(BAD601)  module-1 ppt
Big data analytics(BAD601) module-1 ppt
AmbikaVenkatesh4
 
Lecture 1. Data Structure & Algorithm.pptx
Lecture 1. Data Structure & Algorithm.pptxLecture 1. Data Structure & Algorithm.pptx
Lecture 1. Data Structure & Algorithm.pptx
ArifKamal36
 
Lecture_1_Introduction to Data Structures and Algorithm.pptx
Lecture_1_Introduction to Data Structures and Algorithm.pptxLecture_1_Introduction to Data Structures and Algorithm.pptx
Lecture_1_Introduction to Data Structures and Algorithm.pptx
mueedmughal88
 
Database Systems - introduction
Database Systems - introductionDatabase Systems - introduction
Database Systems - introduction
Jananath Banuka
 
DSA(Lec-1,2,3) For C++ Introduction for basics
DSA(Lec-1,2,3) For C++ Introduction for basicsDSA(Lec-1,2,3) For C++ Introduction for basics
DSA(Lec-1,2,3) For C++ Introduction for basics
x28tjyi81j
 
Basic of Data Structure - Data Structure - Notes
Basic of Data Structure - Data Structure - NotesBasic of Data Structure - Data Structure - Notes
Basic of Data Structure - Data Structure - Notes
Omprakash Chauhan
 
Database Management System
Database Management SystemDatabase Management System
Database Management System
Nishant Munjal
 
database management system - overview of entire dbms
database management system - overview of entire dbmsdatabase management system - overview of entire dbms
database management system - overview of entire dbms
vikramkagitapu
 

Recently uploaded (20)

Antepartum fetal surveillance---Dr. H.K.Cheema pdf.pdf
Antepartum fetal surveillance---Dr. H.K.Cheema pdf.pdfAntepartum fetal surveillance---Dr. H.K.Cheema pdf.pdf
Antepartum fetal surveillance---Dr. H.K.Cheema pdf.pdf
Dr H.K. Cheema
 
EUPHORIA GENERAL QUIZ PRELIMS | QUIZ CLUB OF PSGCAS | 21 MARCH 2025
EUPHORIA GENERAL QUIZ PRELIMS | QUIZ CLUB OF PSGCAS | 21 MARCH 2025EUPHORIA GENERAL QUIZ PRELIMS | QUIZ CLUB OF PSGCAS | 21 MARCH 2025
EUPHORIA GENERAL QUIZ PRELIMS | QUIZ CLUB OF PSGCAS | 21 MARCH 2025
Quiz Club of PSG College of Arts & Science
 
Conditions for Boltzmann Law – Biophysics Lecture Slide
Conditions for Boltzmann Law – Biophysics Lecture SlideConditions for Boltzmann Law – Biophysics Lecture Slide
Conditions for Boltzmann Law – Biophysics Lecture Slide
PKLI-Institute of Nursing and Allied Health Sciences Lahore , Pakistan.
 
Module 1: Foundations of Research
Module 1: Foundations of ResearchModule 1: Foundations of Research
Module 1: Foundations of Research
drroxannekemp
 
PUBH1000 Slides - Module 11: Governance for Health
PUBH1000 Slides - Module 11: Governance for HealthPUBH1000 Slides - Module 11: Governance for Health
PUBH1000 Slides - Module 11: Governance for Health
JonathanHallett4
 
Launch of The State of Global Teenage Career Preparation - Andreas Schleicher...
Launch of The State of Global Teenage Career Preparation - Andreas Schleicher...Launch of The State of Global Teenage Career Preparation - Andreas Schleicher...
Launch of The State of Global Teenage Career Preparation - Andreas Schleicher...
EduSkills OECD
 
LDMMIA 2024 Crystal Gold Lecture 1 Bonus
LDMMIA 2024 Crystal Gold Lecture 1 BonusLDMMIA 2024 Crystal Gold Lecture 1 Bonus
LDMMIA 2024 Crystal Gold Lecture 1 Bonus
LDM & Mia eStudios
 
MCQS (EMERGENCY NURSING) DR. NASIR MUSTAFA
MCQS (EMERGENCY NURSING) DR. NASIR MUSTAFAMCQS (EMERGENCY NURSING) DR. NASIR MUSTAFA
MCQS (EMERGENCY NURSING) DR. NASIR MUSTAFA
Dr. Nasir Mustafa
 
114P_English.pdf114P_English.pdf114P_English.pdf
114P_English.pdf114P_English.pdf114P_English.pdf114P_English.pdf114P_English.pdf114P_English.pdf
114P_English.pdf114P_English.pdf114P_English.pdf
paulinelee52
 
MCQ PHYSIOLOGY II (DR. NASIR MUSTAFA) MCQS)
MCQ PHYSIOLOGY II (DR. NASIR MUSTAFA) MCQS)MCQ PHYSIOLOGY II (DR. NASIR MUSTAFA) MCQS)
MCQ PHYSIOLOGY II (DR. NASIR MUSTAFA) MCQS)
Dr. Nasir Mustafa
 
How to Manage Manual Reordering Rule in Odoo 18 Inventory
How to Manage Manual Reordering Rule in Odoo 18 InventoryHow to Manage Manual Reordering Rule in Odoo 18 Inventory
How to Manage Manual Reordering Rule in Odoo 18 Inventory
Celine George
 
Module_2_Types_and_Approaches_of_Research (2).pptx
Module_2_Types_and_Approaches_of_Research (2).pptxModule_2_Types_and_Approaches_of_Research (2).pptx
Module_2_Types_and_Approaches_of_Research (2).pptx
drroxannekemp
 
IPL QUIZ | THE QUIZ CLUB OF PSGCAS | 2025.pdf
IPL QUIZ | THE QUIZ CLUB OF PSGCAS | 2025.pdfIPL QUIZ | THE QUIZ CLUB OF PSGCAS | 2025.pdf
IPL QUIZ | THE QUIZ CLUB OF PSGCAS | 2025.pdf
Quiz Club of PSG College of Arts & Science
 
The History of Kashmir Lohar Dynasty NEP.ppt
The History of Kashmir Lohar Dynasty NEP.pptThe History of Kashmir Lohar Dynasty NEP.ppt
The History of Kashmir Lohar Dynasty NEP.ppt
Arya Mahila P. G. College, Banaras Hindu University, Varanasi, India.
 
YSPH VMOC Special Report - Measles Outbreak Southwest US 5-14-2025 .pptx
YSPH VMOC Special Report - Measles Outbreak  Southwest US 5-14-2025  .pptxYSPH VMOC Special Report - Measles Outbreak  Southwest US 5-14-2025  .pptx
YSPH VMOC Special Report - Measles Outbreak Southwest US 5-14-2025 .pptx
Yale School of Public Health - The Virtual Medical Operations Center (VMOC)
 
Statement by Linda McMahon on May 21, 2025
Statement by Linda McMahon on May 21, 2025Statement by Linda McMahon on May 21, 2025
Statement by Linda McMahon on May 21, 2025
Mebane Rash
 
How to Configure Extra Steps During Checkout in Odoo 18 Website
How to Configure Extra Steps During Checkout in Odoo 18 WebsiteHow to Configure Extra Steps During Checkout in Odoo 18 Website
How to Configure Extra Steps During Checkout in Odoo 18 Website
Celine George
 
Search Matching Applicants in Odoo 18 - Odoo Slides
Search Matching Applicants in Odoo 18 - Odoo SlidesSearch Matching Applicants in Odoo 18 - Odoo Slides
Search Matching Applicants in Odoo 18 - Odoo Slides
Celine George
 
MICROBIAL GENETICS -tranformation and tranduction.pdf
MICROBIAL GENETICS -tranformation and tranduction.pdfMICROBIAL GENETICS -tranformation and tranduction.pdf
MICROBIAL GENETICS -tranformation and tranduction.pdf
DHARMENDRA SAHU
 
Mental Health Assessment in 5th semester bsc. nursing and also used in 2nd ye...
Mental Health Assessment in 5th semester bsc. nursing and also used in 2nd ye...Mental Health Assessment in 5th semester bsc. nursing and also used in 2nd ye...
Mental Health Assessment in 5th semester bsc. nursing and also used in 2nd ye...
parmarjuli1412
 
Antepartum fetal surveillance---Dr. H.K.Cheema pdf.pdf
Antepartum fetal surveillance---Dr. H.K.Cheema pdf.pdfAntepartum fetal surveillance---Dr. H.K.Cheema pdf.pdf
Antepartum fetal surveillance---Dr. H.K.Cheema pdf.pdf
Dr H.K. Cheema
 
Module 1: Foundations of Research
Module 1: Foundations of ResearchModule 1: Foundations of Research
Module 1: Foundations of Research
drroxannekemp
 
PUBH1000 Slides - Module 11: Governance for Health
PUBH1000 Slides - Module 11: Governance for HealthPUBH1000 Slides - Module 11: Governance for Health
PUBH1000 Slides - Module 11: Governance for Health
JonathanHallett4
 
Launch of The State of Global Teenage Career Preparation - Andreas Schleicher...
Launch of The State of Global Teenage Career Preparation - Andreas Schleicher...Launch of The State of Global Teenage Career Preparation - Andreas Schleicher...
Launch of The State of Global Teenage Career Preparation - Andreas Schleicher...
EduSkills OECD
 
LDMMIA 2024 Crystal Gold Lecture 1 Bonus
LDMMIA 2024 Crystal Gold Lecture 1 BonusLDMMIA 2024 Crystal Gold Lecture 1 Bonus
LDMMIA 2024 Crystal Gold Lecture 1 Bonus
LDM & Mia eStudios
 
MCQS (EMERGENCY NURSING) DR. NASIR MUSTAFA
MCQS (EMERGENCY NURSING) DR. NASIR MUSTAFAMCQS (EMERGENCY NURSING) DR. NASIR MUSTAFA
MCQS (EMERGENCY NURSING) DR. NASIR MUSTAFA
Dr. Nasir Mustafa
 
114P_English.pdf114P_English.pdf114P_English.pdf
114P_English.pdf114P_English.pdf114P_English.pdf114P_English.pdf114P_English.pdf114P_English.pdf
114P_English.pdf114P_English.pdf114P_English.pdf
paulinelee52
 
MCQ PHYSIOLOGY II (DR. NASIR MUSTAFA) MCQS)
MCQ PHYSIOLOGY II (DR. NASIR MUSTAFA) MCQS)MCQ PHYSIOLOGY II (DR. NASIR MUSTAFA) MCQS)
MCQ PHYSIOLOGY II (DR. NASIR MUSTAFA) MCQS)
Dr. Nasir Mustafa
 
How to Manage Manual Reordering Rule in Odoo 18 Inventory
How to Manage Manual Reordering Rule in Odoo 18 InventoryHow to Manage Manual Reordering Rule in Odoo 18 Inventory
How to Manage Manual Reordering Rule in Odoo 18 Inventory
Celine George
 
Module_2_Types_and_Approaches_of_Research (2).pptx
Module_2_Types_and_Approaches_of_Research (2).pptxModule_2_Types_and_Approaches_of_Research (2).pptx
Module_2_Types_and_Approaches_of_Research (2).pptx
drroxannekemp
 
Statement by Linda McMahon on May 21, 2025
Statement by Linda McMahon on May 21, 2025Statement by Linda McMahon on May 21, 2025
Statement by Linda McMahon on May 21, 2025
Mebane Rash
 
How to Configure Extra Steps During Checkout in Odoo 18 Website
How to Configure Extra Steps During Checkout in Odoo 18 WebsiteHow to Configure Extra Steps During Checkout in Odoo 18 Website
How to Configure Extra Steps During Checkout in Odoo 18 Website
Celine George
 
Search Matching Applicants in Odoo 18 - Odoo Slides
Search Matching Applicants in Odoo 18 - Odoo SlidesSearch Matching Applicants in Odoo 18 - Odoo Slides
Search Matching Applicants in Odoo 18 - Odoo Slides
Celine George
 
MICROBIAL GENETICS -tranformation and tranduction.pdf
MICROBIAL GENETICS -tranformation and tranduction.pdfMICROBIAL GENETICS -tranformation and tranduction.pdf
MICROBIAL GENETICS -tranformation and tranduction.pdf
DHARMENDRA SAHU
 
Mental Health Assessment in 5th semester bsc. nursing and also used in 2nd ye...
Mental Health Assessment in 5th semester bsc. nursing and also used in 2nd ye...Mental Health Assessment in 5th semester bsc. nursing and also used in 2nd ye...
Mental Health Assessment in 5th semester bsc. nursing and also used in 2nd ye...
parmarjuli1412
 
Ad

Lesson 1 - Data Structures and Algorithms Overview.pdf

  • 1. DATA STRUCTURES AND ALGORITHMS
  • 2. DATA STRUCTURES AND ALGORITHMS - DEFINED Data structure  is an arrangement of data in a computer's memory or even disk storage. Examples : Arrays, lists, sets, queues, stacks, binary trees, hash tables, and graphs. Algorithms  are used to manipulate the data contained in these data structures as in searching and sorting. Many algorithms apply directly to a specific data structures. When working with certain data structures you need to know how to insert new data, search for a specified item, and deleting a specific item.
  • 3. DATA STRUCTURES AND ALGORITHMS - DEFINED Commonly used algorithms include are useful for:  Searching for a particular data item (or record).  Sorting the data.  Iterating through all the items in a data structure. (Visiting each item in turn so as to display it or perform some other action on these items)
  • 4. WHY DO WE NEED DATA STRUCTURES ?  Data structure is a particular way of storing and organizing information in a computer so that it can be retrieved and used most productively.  Each Data Structure allows data to be stored in specific manner.  Data Structure allows efficient data search and retrieval.  Specific Data structures are decided to work for specific problems.  It allows to manage large amount of data such as large databases and indexing services such as hash table. The choice of data structure and algorithm can make the difference between a program running in a few seconds or many days.
  • 5. HOW TO SELECT DATA STRUCTURE? When selecting a data structure to solve a problem, you should follow these steps. 1. Analyze your problem to determine the basic operations that must be supported. Examples of basic operations include inserting a data item into the data structure, deleting a data item from the data structure, and finding a specified data item. 2. Quantify the resource constraints for each operation. 3. Select the data structure that best meets these requirements Some questions to ask:  Are all data inserted into the data structure at the beginning, or are insertions interspersed with other operations?  Can data be deleted?  Are all data processed in some well-defined order, or is random access allowed?
  • 6. DATA STRUCTURE PHILOSOPHY 1. Each data structure has costs and benefits. 2. Rarely is one data structure better than another in all situations. 3. A data structure requires:  space for each data item it stores,  time to perform each basic operation,  programming effort. 4. Each problem has constraints on available space and time. 5. Only after a careful analysis of problem characteristics can we know the best data structure for the task.
  • 7. ABSTRACT DATA TYPES  A type is a collection of values.  A data type is a type together with a collection of operations to manipulate the type.  A data item is a piece of information or a record whose value is drawn from a type. A data item is said to be a member of a type.  An abstract data type (ADT) is the specification of a data type within some language, independent of an implementation.  The interface for the ADT is defined in terms of a type and a set of operations on that type.  The behavior of each operation is determined by its inputs and outputs.  An ADT does not specify how the data type is implemented.  These implementation details are hidden from the user of the ADT and protected from outside access, a concept referred to as encapsulation.  A data structure is the implementation for an ADT.  In an object-oriented language, an ADT and its implementation together make up a class.  Each operation associated with the ADT is implemented by a member function or method.  The variables that define the space required by a data item are referred to as data members.  An object is an instance of a class, that is, something that is created and takes up storage during the execution of a computer program.
  • 8. MOTIVATING QUOTATIONS “Every program depends on algorithms and data structures, but few programs depend on the invention of brand new ones.” -- Kernighan & Pike! “I will, in fact, claim that the difference between a bad programmer and a good one is whether he considers his code or his data structures more important. Bad programmers worry about the code. Good programmers worry about data structures and their relationships.” -- Linus Torvalds!
  翻译: