SlideShare a Scribd company logo
1 of 22
Sana Yaqoob
sanasundas618@GMAIL.C
OM
Lecture 1
DATA STRUC TURE S AND
ALGORITHMS
COURSE OBJECTIVE
The main objective of the course is to teach the
students how to select and design data structures and
algorithms that are appropriate for real world problem
solving.
Developing basic algorithms for manipulating stacks,
queues, linked lists, trees, graphs.
Developing the data structures (abstract data types)
for implementing the aforementioned algorithms.
Developing recursive algorithms for application in
trees and graphs.
This course is also about showing the correctness of
algorithms and studying their computational
complexities.
COURSE OUTCOMES
On the successful completion of
students are expected to:
Understand the principle behind
the course,
the use of
Abstract Data Types (ADT)
Learn the commonly used ADT’s and their
implementation
Learn basic algorithms and basic methods used in
design of algorithms
Learn to compute the cost and benefits of
different data structures and algorithms and how
to select algorithms and data structures for a
particular problem.
COURSE INFORMATION
 Textbooks
⚫ Data Structures Using C and C++
by Y. Langsam, M. J . Augenstein, A. M.
Tenenbaum
⚫ Introduction to Data Structures in C
by Ashok N. Kamthane
⚫ Data Structures and Algorithms
by A. V. Aho, J . E. Hopcroft, J . D. Ullman
⚫ Algorithms in C++
by Robert Sedgewick
COURSE OUTLINE
 Introduction to Data Structure
 Algorithms
 Recursion
 Stacks
 Queues
 Lists and linked lists
 Trees
 Sorting
 Searching
 Graphs
 Hashing
GRADING
 Theory
⚫ Quizzes ---------------10%
⚫ Project/Assignments/Presentations ---------20%
⚫ Mid Term-------------- 20%
⚫ Final-------------------- 50%
 Lab
⚫ Quizzes ---------------10%
⚫ Lab journals/Assessments-----40%
⚫ Mid Term-------------- 20%
⚫ Final-------------------- 30%
INTRODUCTION TO DATA
ST RUC T URE AND
ABSTRACT DATA TYPES
Week 1
WHAT IS DATA STRUCTURE?
 Data structure is a representation of data and
the operations allowed on that data.
• A data structure is a way to store and organize data in order
to facilitate the access and modifications.
• Data Structure are the method of representing of logical
relationships between individual data elements related to the
solution of a given problem.
BASIC DATA STRUCTURE
Basic Data Structures
Linear Data Structures Non-Linear Data Structures
Arrays Linked Lists Stacks Queues Trees Graphs Hash Tables
array
Linked list
tree
queue
stack
SELECTION OF DATA STRUCTURE
 The choice of particular data model
depends on two consideration:
⚫ It must be rich enough in structure to represent
the relationship between data elements
⚫ The structure should be simple enough that one
can effectively process the data when necessary
TYPES OF DATA STRUCTURE
 Linear: In Linear data structure, values are arrange in
linear fashion.
⚫ Array: Fixed-size
⚫ Linked-list: Variable-size
⚫ Stack: Add to top and remove from top
⚫ Queue: Add to back and remove from front
⚫ Priority queue: Add anywhere, remove the highest
priority
TYPES OF DATA STRUCTURE
 Non-Linear: The data values in this structure are
not arranged in order.
⚫ Hash tables: Unordered lists which use a ‘hash function’
to insert and search
⚫ Tree: Data is organized in branches.
⚫ Graph: A more general branching structure, with less
strict connection conditions than for a tree
TYPE OF DATA STRUCTURES
 Homogenous: In this type of data structures,
values of the same types of data are stored.
⚫ Array
 Non-Homogenous: In this type of data structures,
data values of different types are grouped and
stored.
⚫ Structures
⚫ Classes
ABSTRACT DATA TYPE AND DATA STRUCTURE
 Definition:-
⚫ Abstract Data Types (ADTs) store data and allow various
operations on the data to access and change it.
⚫ An ADT is a collection of data and associated operations for
manipulating that data.
 Data Structures
⚫ Physical implementation of an ADT
⚫ data structures used in implementations are provided in a
language (primitive or built-in) or are built from the language
constructs (user-defined)
⚫ Each operation associated with theADT is implemented by one or
more subroutines in the implementation
ABSTRACT DATA TYPE
 ADTs support abstraction, encapsulation, and
information hiding.
 Abstraction is the structuring of a problem into
well-defined entities by defining their data and
operations.
 The principle of hiding the used data structure
and to only provide a well-defined interface is
known as encapsulation.
THE CORE OPERATIONS OF ADT
 Every Collection ADT should provide a
way to:
⚫ add an item
⚫ remove an item
⚫ find, retrieve, or access an item
 Many, many more possibilities
⚫ is the collection empty
⚫ make the collection empty
⚫ give me a sub set of the collection
No single data structure works well for all purposes, and
so it is important to know the strengths and limitations
of several of them
IMPORTANT !!!
STACKS
 Collection with access only to the last element
inserted
 Last in first out
 insert/push
 remove/pop
 top
 make empty
Data4
Data3
Data2
Data1
T
op
QU E U ES
 Collection with access only to the item that has
been present the longest
 Last in last out or first in first out
 enqueue, dequeue, front
 priority queues and dequeue
Data1 Data2 Data3 Data4
Front Back
LIST
 A Flexible structure, because can grow and
shrink on demand.
Elements can be:
 Inserted
 Accessed
 Deleted
At any position
last
first
TREE
 A Tree is a collection of elements called nodes.
 One of the node is distinguished as a root, along with a
relation (“parenthood”) that places a hierarchical structure
on the nodes.
Root

More Related Content

Similar to Lecture_1_Introduction to Data Structures and Algorithm.pptx

Unit.1 Introduction to Data Structuresres
Unit.1 Introduction to Data StructuresresUnit.1 Introduction to Data Structuresres
Unit.1 Introduction to Data Structuresresamplopsurat
 
dbms lecture 1.pptx , where traditional file system vs database management ar...
dbms lecture 1.pptx , where traditional file system vs database management ar...dbms lecture 1.pptx , where traditional file system vs database management ar...
dbms lecture 1.pptx , where traditional file system vs database management ar...dbmscse61
 
Data Structure 1..Vary Basic introduction about DSA using c++.pptx
Data Structure 1..Vary Basic introduction  about DSA using c++.pptxData Structure 1..Vary Basic introduction  about DSA using c++.pptx
Data Structure 1..Vary Basic introduction about DSA using c++.pptxvbthakur01
 
Introduction to data structure
Introduction to data structureIntroduction to data structure
Introduction to data structureadeel hamid
 
Lecture 1 IntroductionToDataStructures_coursematerial_Draft0.01.ppt
Lecture 1 IntroductionToDataStructures_coursematerial_Draft0.01.pptLecture 1 IntroductionToDataStructures_coursematerial_Draft0.01.ppt
Lecture 1 IntroductionToDataStructures_coursematerial_Draft0.01.pptiamsallauddin
 
Iare ds lecture_notes_2
Iare ds lecture_notes_2Iare ds lecture_notes_2
Iare ds lecture_notes_2RajSingh734307
 
Se 381 - lec 21 - 23 - 12 may09 - df-ds and data dictionary
Se 381 - lec 21 - 23 - 12 may09 - df-ds and data dictionarySe 381 - lec 21 - 23 - 12 may09 - df-ds and data dictionary
Se 381 - lec 21 - 23 - 12 may09 - df-ds and data dictionarybabak danyal
 
DATA STRUCTURE AND ALGORITHMS
DATA STRUCTURE AND ALGORITHMS DATA STRUCTURE AND ALGORITHMS
DATA STRUCTURE AND ALGORITHMS Adams Sidibe
 
DS Module 1.pptx
DS Module 1.pptxDS Module 1.pptx
DS Module 1.pptxsarala9
 
Data structure and algorithm.
Data structure and algorithm. Data structure and algorithm.
Data structure and algorithm. Abdul salam
 
Data structures and algorithms short note (version 14).pd
Data structures and algorithms short note (version 14).pdData structures and algorithms short note (version 14).pd
Data structures and algorithms short note (version 14).pdNimmi Weeraddana
 
Presentations, Documents, Infographics, and more
Presentations, Documents, Infographics, and morePresentations, Documents, Infographics, and more
Presentations, Documents, Infographics, and moreKwadjoOwusuAnsahQuar
 
Data Structure.pptx
Data Structure.pptxData Structure.pptx
Data Structure.pptxSajalFayyaz
 
DSA 1- Introduction.pdf
DSA 1- Introduction.pdfDSA 1- Introduction.pdf
DSA 1- Introduction.pdfAliyanAbbas1
 
Lecture 01 Intro to DSA
Lecture 01 Intro to DSALecture 01 Intro to DSA
Lecture 01 Intro to DSANurjahan Nipa
 

Similar to Lecture_1_Introduction to Data Structures and Algorithm.pptx (20)

Unit.1 Introduction to Data Structuresres
Unit.1 Introduction to Data StructuresresUnit.1 Introduction to Data Structuresres
Unit.1 Introduction to Data Structuresres
 
dbms lecture 1.pptx , where traditional file system vs database management ar...
dbms lecture 1.pptx , where traditional file system vs database management ar...dbms lecture 1.pptx , where traditional file system vs database management ar...
dbms lecture 1.pptx , where traditional file system vs database management ar...
 
Lect 1-2
Lect 1-2Lect 1-2
Lect 1-2
 
Data Structure 1..Vary Basic introduction about DSA using c++.pptx
Data Structure 1..Vary Basic introduction  about DSA using c++.pptxData Structure 1..Vary Basic introduction  about DSA using c++.pptx
Data Structure 1..Vary Basic introduction about DSA using c++.pptx
 
Introduction to data structure
Introduction to data structureIntroduction to data structure
Introduction to data structure
 
Datastructures Notes
Datastructures NotesDatastructures Notes
Datastructures Notes
 
Lecture 1 IntroductionToDataStructures_coursematerial_Draft0.01.ppt
Lecture 1 IntroductionToDataStructures_coursematerial_Draft0.01.pptLecture 1 IntroductionToDataStructures_coursematerial_Draft0.01.ppt
Lecture 1 IntroductionToDataStructures_coursematerial_Draft0.01.ppt
 
Iare ds lecture_notes_2
Iare ds lecture_notes_2Iare ds lecture_notes_2
Iare ds lecture_notes_2
 
Se 381 - lec 21 - 23 - 12 may09 - df-ds and data dictionary
Se 381 - lec 21 - 23 - 12 may09 - df-ds and data dictionarySe 381 - lec 21 - 23 - 12 may09 - df-ds and data dictionary
Se 381 - lec 21 - 23 - 12 may09 - df-ds and data dictionary
 
DATA STRUCTURE AND ALGORITHMS
DATA STRUCTURE AND ALGORITHMS DATA STRUCTURE AND ALGORITHMS
DATA STRUCTURE AND ALGORITHMS
 
DS Module 1.pptx
DS Module 1.pptxDS Module 1.pptx
DS Module 1.pptx
 
Data structure and algorithm.
Data structure and algorithm. Data structure and algorithm.
Data structure and algorithm.
 
Data structures and algorithms short note (version 14).pd
Data structures and algorithms short note (version 14).pdData structures and algorithms short note (version 14).pd
Data structures and algorithms short note (version 14).pd
 
Presentations, Documents, Infographics, and more
Presentations, Documents, Infographics, and morePresentations, Documents, Infographics, and more
Presentations, Documents, Infographics, and more
 
Data Structure.pptx
Data Structure.pptxData Structure.pptx
Data Structure.pptx
 
DSA 1- Introduction.pdf
DSA 1- Introduction.pdfDSA 1- Introduction.pdf
DSA 1- Introduction.pdf
 
104333 sri vidhya eng notes
104333 sri vidhya eng notes104333 sri vidhya eng notes
104333 sri vidhya eng notes
 
Lecture 01 Intro to DSA
Lecture 01 Intro to DSALecture 01 Intro to DSA
Lecture 01 Intro to DSA
 
UNIT I - Data Structures.pdf
UNIT I - Data Structures.pdfUNIT I - Data Structures.pdf
UNIT I - Data Structures.pdf
 
Dsa unit 1
Dsa unit 1Dsa unit 1
Dsa unit 1
 

Recently uploaded

會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽中 央社
 
male presentation...pdf.................
male presentation...pdf.................male presentation...pdf.................
male presentation...pdf.................MirzaAbrarBaig5
 
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...Nguyen Thanh Tu Collection
 
Personalisation of Education by AI and Big Data - Lourdes Guàrdia
Personalisation of Education by AI and Big Data - Lourdes GuàrdiaPersonalisation of Education by AI and Big Data - Lourdes Guàrdia
Personalisation of Education by AI and Big Data - Lourdes GuàrdiaEADTU
 
The Liver & Gallbladder (Anatomy & Physiology).pptx
The Liver &  Gallbladder (Anatomy & Physiology).pptxThe Liver &  Gallbladder (Anatomy & Physiology).pptx
The Liver & Gallbladder (Anatomy & Physiology).pptxVishal Singh
 
Trauma-Informed Leadership - Five Practical Principles
Trauma-Informed Leadership - Five Practical PrinciplesTrauma-Informed Leadership - Five Practical Principles
Trauma-Informed Leadership - Five Practical PrinciplesPooky Knightsmith
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxannathomasp01
 
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSSpellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSAnaAcapella
 
OSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & SystemsOSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & SystemsSandeep D Chaudhary
 
PSYPACT- Practicing Over State Lines May 2024.pptx
PSYPACT- Practicing Over State Lines May 2024.pptxPSYPACT- Practicing Over State Lines May 2024.pptx
PSYPACT- Practicing Over State Lines May 2024.pptxMarlene Maheu
 
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdfFICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdfPondicherry University
 
DEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUM
DEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUMDEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUM
DEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUMELOISARIVERA8
 
When Quality Assurance Meets Innovation in Higher Education - Report launch w...
When Quality Assurance Meets Innovation in Higher Education - Report launch w...When Quality Assurance Meets Innovation in Higher Education - Report launch w...
When Quality Assurance Meets Innovation in Higher Education - Report launch w...Gary Wood
 
SPLICE Working Group: Reusable Code Examples
SPLICE Working Group:Reusable Code ExamplesSPLICE Working Group:Reusable Code Examples
SPLICE Working Group: Reusable Code ExamplesPeter Brusilovsky
 
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文中 央社
 
MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...
MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...
MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...MysoreMuleSoftMeetup
 
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading Room
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading RoomSternal Fractures & Dislocations - EMGuidewire Radiology Reading Room
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading RoomSean M. Fox
 
The Story of Village Palampur Class 9 Free Study Material PDF
The Story of Village Palampur Class 9 Free Study Material PDFThe Story of Village Palampur Class 9 Free Study Material PDF
The Story of Village Palampur Class 9 Free Study Material PDFVivekanand Anglo Vedic Academy
 
Improved Approval Flow in Odoo 17 Studio App
Improved Approval Flow in Odoo 17 Studio AppImproved Approval Flow in Odoo 17 Studio App
Improved Approval Flow in Odoo 17 Studio AppCeline George
 

Recently uploaded (20)

會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
 
male presentation...pdf.................
male presentation...pdf.................male presentation...pdf.................
male presentation...pdf.................
 
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
 
Personalisation of Education by AI and Big Data - Lourdes Guàrdia
Personalisation of Education by AI and Big Data - Lourdes GuàrdiaPersonalisation of Education by AI and Big Data - Lourdes Guàrdia
Personalisation of Education by AI and Big Data - Lourdes Guàrdia
 
The Liver & Gallbladder (Anatomy & Physiology).pptx
The Liver &  Gallbladder (Anatomy & Physiology).pptxThe Liver &  Gallbladder (Anatomy & Physiology).pptx
The Liver & Gallbladder (Anatomy & Physiology).pptx
 
Trauma-Informed Leadership - Five Practical Principles
Trauma-Informed Leadership - Five Practical PrinciplesTrauma-Informed Leadership - Five Practical Principles
Trauma-Informed Leadership - Five Practical Principles
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
 
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSSpellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
 
OSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & SystemsOSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & Systems
 
PSYPACT- Practicing Over State Lines May 2024.pptx
PSYPACT- Practicing Over State Lines May 2024.pptxPSYPACT- Practicing Over State Lines May 2024.pptx
PSYPACT- Practicing Over State Lines May 2024.pptx
 
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdfFICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
 
DEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUM
DEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUMDEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUM
DEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUM
 
When Quality Assurance Meets Innovation in Higher Education - Report launch w...
When Quality Assurance Meets Innovation in Higher Education - Report launch w...When Quality Assurance Meets Innovation in Higher Education - Report launch w...
When Quality Assurance Meets Innovation in Higher Education - Report launch w...
 
ESSENTIAL of (CS/IT/IS) class 07 (Networks)
ESSENTIAL of (CS/IT/IS) class 07 (Networks)ESSENTIAL of (CS/IT/IS) class 07 (Networks)
ESSENTIAL of (CS/IT/IS) class 07 (Networks)
 
SPLICE Working Group: Reusable Code Examples
SPLICE Working Group:Reusable Code ExamplesSPLICE Working Group:Reusable Code Examples
SPLICE Working Group: Reusable Code Examples
 
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
 
MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...
MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...
MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...
 
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading Room
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading RoomSternal Fractures & Dislocations - EMGuidewire Radiology Reading Room
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading Room
 
The Story of Village Palampur Class 9 Free Study Material PDF
The Story of Village Palampur Class 9 Free Study Material PDFThe Story of Village Palampur Class 9 Free Study Material PDF
The Story of Village Palampur Class 9 Free Study Material PDF
 
Improved Approval Flow in Odoo 17 Studio App
Improved Approval Flow in Odoo 17 Studio AppImproved Approval Flow in Odoo 17 Studio App
Improved Approval Flow in Odoo 17 Studio App
 

Lecture_1_Introduction to Data Structures and Algorithm.pptx

  • 2. COURSE OBJECTIVE The main objective of the course is to teach the students how to select and design data structures and algorithms that are appropriate for real world problem solving. Developing basic algorithms for manipulating stacks, queues, linked lists, trees, graphs. Developing the data structures (abstract data types) for implementing the aforementioned algorithms. Developing recursive algorithms for application in trees and graphs. This course is also about showing the correctness of algorithms and studying their computational complexities.
  • 3. COURSE OUTCOMES On the successful completion of students are expected to: Understand the principle behind the course, the use of Abstract Data Types (ADT) Learn the commonly used ADT’s and their implementation Learn basic algorithms and basic methods used in design of algorithms Learn to compute the cost and benefits of different data structures and algorithms and how to select algorithms and data structures for a particular problem.
  • 4. COURSE INFORMATION  Textbooks ⚫ Data Structures Using C and C++ by Y. Langsam, M. J . Augenstein, A. M. Tenenbaum ⚫ Introduction to Data Structures in C by Ashok N. Kamthane ⚫ Data Structures and Algorithms by A. V. Aho, J . E. Hopcroft, J . D. Ullman ⚫ Algorithms in C++ by Robert Sedgewick
  • 5. COURSE OUTLINE  Introduction to Data Structure  Algorithms  Recursion  Stacks  Queues  Lists and linked lists  Trees  Sorting  Searching  Graphs  Hashing
  • 6. GRADING  Theory ⚫ Quizzes ---------------10% ⚫ Project/Assignments/Presentations ---------20% ⚫ Mid Term-------------- 20% ⚫ Final-------------------- 50%  Lab ⚫ Quizzes ---------------10% ⚫ Lab journals/Assessments-----40% ⚫ Mid Term-------------- 20% ⚫ Final-------------------- 30%
  • 7. INTRODUCTION TO DATA ST RUC T URE AND ABSTRACT DATA TYPES Week 1
  • 8. WHAT IS DATA STRUCTURE?  Data structure is a representation of data and the operations allowed on that data. • A data structure is a way to store and organize data in order to facilitate the access and modifications. • Data Structure are the method of representing of logical relationships between individual data elements related to the solution of a given problem.
  • 9. BASIC DATA STRUCTURE Basic Data Structures Linear Data Structures Non-Linear Data Structures Arrays Linked Lists Stacks Queues Trees Graphs Hash Tables
  • 11. SELECTION OF DATA STRUCTURE  The choice of particular data model depends on two consideration: ⚫ It must be rich enough in structure to represent the relationship between data elements ⚫ The structure should be simple enough that one can effectively process the data when necessary
  • 12. TYPES OF DATA STRUCTURE  Linear: In Linear data structure, values are arrange in linear fashion. ⚫ Array: Fixed-size ⚫ Linked-list: Variable-size ⚫ Stack: Add to top and remove from top ⚫ Queue: Add to back and remove from front ⚫ Priority queue: Add anywhere, remove the highest priority
  • 13. TYPES OF DATA STRUCTURE  Non-Linear: The data values in this structure are not arranged in order. ⚫ Hash tables: Unordered lists which use a ‘hash function’ to insert and search ⚫ Tree: Data is organized in branches. ⚫ Graph: A more general branching structure, with less strict connection conditions than for a tree
  • 14. TYPE OF DATA STRUCTURES  Homogenous: In this type of data structures, values of the same types of data are stored. ⚫ Array  Non-Homogenous: In this type of data structures, data values of different types are grouped and stored. ⚫ Structures ⚫ Classes
  • 15. ABSTRACT DATA TYPE AND DATA STRUCTURE  Definition:- ⚫ Abstract Data Types (ADTs) store data and allow various operations on the data to access and change it. ⚫ An ADT is a collection of data and associated operations for manipulating that data.  Data Structures ⚫ Physical implementation of an ADT ⚫ data structures used in implementations are provided in a language (primitive or built-in) or are built from the language constructs (user-defined) ⚫ Each operation associated with theADT is implemented by one or more subroutines in the implementation
  • 16. ABSTRACT DATA TYPE  ADTs support abstraction, encapsulation, and information hiding.  Abstraction is the structuring of a problem into well-defined entities by defining their data and operations.  The principle of hiding the used data structure and to only provide a well-defined interface is known as encapsulation.
  • 17. THE CORE OPERATIONS OF ADT  Every Collection ADT should provide a way to: ⚫ add an item ⚫ remove an item ⚫ find, retrieve, or access an item  Many, many more possibilities ⚫ is the collection empty ⚫ make the collection empty ⚫ give me a sub set of the collection
  • 18. No single data structure works well for all purposes, and so it is important to know the strengths and limitations of several of them IMPORTANT !!!
  • 19. STACKS  Collection with access only to the last element inserted  Last in first out  insert/push  remove/pop  top  make empty Data4 Data3 Data2 Data1 T op
  • 20. QU E U ES  Collection with access only to the item that has been present the longest  Last in last out or first in first out  enqueue, dequeue, front  priority queues and dequeue Data1 Data2 Data3 Data4 Front Back
  • 21. LIST  A Flexible structure, because can grow and shrink on demand. Elements can be:  Inserted  Accessed  Deleted At any position last first
  • 22. TREE  A Tree is a collection of elements called nodes.  One of the node is distinguished as a root, along with a relation (“parenthood”) that places a hierarchical structure on the nodes. Root