SlideShare a Scribd company logo
Lecture 1
Data Structures
Introduction
• Course outline
• Rules and regulations
• Course contents
• Good Programming Practices
• Data Types and Data Structures
• ADT
Course Description
• Title: Data Structures and Algorithms
• Code: CMP-210
• Credit Hours:3
• Prerequisite: OOP
• Follow Up: Design and Analysis of Algorithms
Contents
• Introduction to Algorithms
• Arrays
• Stacks
• Recursion
• Queues
• Lists and its variations
• Trees
• Hashing
• Searching and sorting Techniques
• Graphs
Good Programming Practices
• Programs and subprograms should be well structured.
Use a modular approach for a complex problem.
Use the basic control structures when developing each code
segment.
Sequence, selection, repetition
Use local variables within subprograms.
Use parameters to pass information to and from subprograms.
Avoid global Variables.
• All source code should be documented.
 Each program should include opening documentation.
 Each subprogram should be documented in a manner similar to
programs.
 Comments should be used to explain key code segments and / or
segments whose purpose or design is not obvious.
 Use meaningful identifiers.
Good Programming Practices
• Source code should be aesthetic; it should be formatted in a
style that enhances its readability.
Put each statement of the program on a separate line.
Use uppercase and lowercase letters in a way that contributes
to program readability.
Put each {and} on separate lines.
Align each {and corresponding}.
When a statement is continued from one line to another, indent
the continued line(s).
Align the identifiers in each constant and variable declaration,
placing each on a separate line.
Insert blank lines between declarations and statements and
between blocks of statements to make clear the structure of the
program.
Data Types
In computer programming, a data type is a classification
identifying one of various types of data, such as floating-point,..
• Simple (basic)
– char, int, float, double
• Modifiers
– signed, unsigned
• Qualifiers
– static, const, volatile, void
• Structured (derived)
– Arrays, structures, unions, classes
• Advanced (composite)
– List, queues, stacks, trees, graphs
Data Structures and algorithms
• Algorithms
– Outline, the essence of a computational procedure, step
by step instruction
• Program
– An implementation of an algorithm in some computer
programming languages
• Data Structures
– Goal: organize data
– Criteria: facilitate efficient
• storage of data
• Retrieval/recovery of data
• Operation/manipulation of data
• Process:
– select and design appropriate data types
Data may be organized in many
different ways. the logical and
mathematical model of a
particular organization of data
is called Data structure
Need for Data Structures
 Data structures organize data  more
efficient programs.
 More powerful computers  more
complex applications.
 More complex applications demand more
calculations.
Organizing Data
 Any organization for a collection of records
that can be searched, processed in any
order, or modified.
 The choice of data structure and algorithm
can make the difference between a
program running in a few seconds or many
days.
Efficiency
 A solution is said to be efficient if it solves
the problem within its resource constraints.
– Space
– Time
 The cost of a solution is the amount of
resources that the solution consumes.
Selecting a Data Structure
Select a data structure as follows:
1. Analyze the problem to determine the
resource limitations a solution must meet.
2. Determine the basic operations that must
be supported. Count the resource
limitations for each operation.
3. Select the data structure that best meets
these requirements.
Examples
Searching an online phone directory: Linear search?
OK for small organizations
too slow for large ones
 Amount of data is an important factor.
Compiler lookup of an identifier's type, etc. in a symbol table:
Linear search? No, too slow
Binary search? No, too much work to keep sorted
 Number of accesses & speed required is an important factor.
Use hash tables
Text processing: Store in an array / vector?
OK for text analysis — word counts, average word length, etc.
Not for word-processing — Too inefficient if many insertions & deletions
   Static vs. dynamic nature of the data is an important factor
Abstract Data Type (ADT)
• Abstraction
– Separating data from operation
– Generalization
– a concept or idea not associated with any specific
instance
• ADT(Abstract Data Type)
– A collection of related data items together with basic
operations between them and operations to be performed
on them
– A data type is a collection of values and set of operation on
those values
• values and operation that are implemented using a hardware or
software data structure
abstract data type (ADT)
a collection of
related data items together with
an assoicated set of operations
e.g. whole numbers (integers) and arithmetic operators for
addition, subtraction, multiplication and division.
Why "abstract?"
Data, operations, and relations are studied
independent of implementation.
What not how is the focus.
implementation of an ADT
consists of
storage structures (aka data structures) to store the data items
and
algorithms for the basic operations and relations.
The storage structures/data structures used in implementation are
provided in a language (primitive or built-in)
or built from the language constructs (user-defined).
In either case, successful software design uses data abstraction:
Separating the definition of a data type from its implementation.
Goals of this Course
1. Reinforce the concept that costs and benefits
exist for every data structure.
2. Learn the commonly used data structures.
– These form a programmer's basic data structure
“toolkit”.
3. Understand how to measure the cost of a data
structure or program.
– These techniques also allow you to judge the merits
of new data structures that you or others might
invent.

More Related Content

What's hot

1.1 binary tree
1.1 binary tree1.1 binary tree
1.1 binary tree
Krish_ver2
 
FUNCTION DEPENDENCY AND TYPES & EXAMPLE
FUNCTION DEPENDENCY  AND TYPES & EXAMPLEFUNCTION DEPENDENCY  AND TYPES & EXAMPLE
FUNCTION DEPENDENCY AND TYPES & EXAMPLE
Vraj Patel
 
B trees in Data Structure
B trees in Data StructureB trees in Data Structure
B trees in Data Structure
Anuj Modi
 
Applications of data structures
Applications of data structuresApplications of data structures
Applications of data structures
Wipro
 
Data structure ppt
Data structure pptData structure ppt
Data structure ppt
Prof. Dr. K. Adisesha
 
Basics of c++ Programming Language
Basics of c++ Programming LanguageBasics of c++ Programming Language
Basics of c++ Programming Language
Ahmad Idrees
 
Data structure and algorithm using java
Data structure and algorithm using javaData structure and algorithm using java
Data structure and algorithm using java
Narayan Sau
 
Er model ppt
Er model pptEr model ppt
Er model ppt
Pihu Goel
 
Linear search-and-binary-search
Linear search-and-binary-searchLinear search-and-binary-search
Linear search-and-binary-search
International Islamic University
 
heap Sort Algorithm
heap  Sort Algorithmheap  Sort Algorithm
heap Sort Algorithm
Lemia Algmri
 
Output primitives in Computer Graphics
Output primitives in Computer GraphicsOutput primitives in Computer Graphics
Output primitives in Computer Graphics
Kamal Acharya
 
Breadth First Search & Depth First Search
Breadth First Search & Depth First SearchBreadth First Search & Depth First Search
Breadth First Search & Depth First Search
Kevin Jadiya
 
Introduction to c++ ppt 1
Introduction to c++ ppt 1Introduction to c++ ppt 1
Introduction to c++ ppt 1
Prof. Dr. K. Adisesha
 
daa-unit-3-greedy method
daa-unit-3-greedy methoddaa-unit-3-greedy method
daa-unit-3-greedy method
hodcsencet
 
Conditional and control statement
Conditional and control statementConditional and control statement
Conditional and control statement
narmadhakin
 
ER-Model-ER Diagram
ER-Model-ER DiagramER-Model-ER Diagram
ER-Model-ER Diagram
Saranya Natarajan
 
Introduction to Array ppt
Introduction to Array pptIntroduction to Array ppt
Introduction to Array ppt
sandhya yadav
 
Relational model
Relational modelRelational model
Relational model
Dabbal Singh Mahara
 
Data types in java
Data types in javaData types in java
Data types in java
HarshitaAshwani
 
2D transformation (Computer Graphics)
2D transformation (Computer Graphics)2D transformation (Computer Graphics)
2D transformation (Computer Graphics)
Timbal Mayank
 

What's hot (20)

1.1 binary tree
1.1 binary tree1.1 binary tree
1.1 binary tree
 
FUNCTION DEPENDENCY AND TYPES & EXAMPLE
FUNCTION DEPENDENCY  AND TYPES & EXAMPLEFUNCTION DEPENDENCY  AND TYPES & EXAMPLE
FUNCTION DEPENDENCY AND TYPES & EXAMPLE
 
B trees in Data Structure
B trees in Data StructureB trees in Data Structure
B trees in Data Structure
 
Applications of data structures
Applications of data structuresApplications of data structures
Applications of data structures
 
Data structure ppt
Data structure pptData structure ppt
Data structure ppt
 
Basics of c++ Programming Language
Basics of c++ Programming LanguageBasics of c++ Programming Language
Basics of c++ Programming Language
 
Data structure and algorithm using java
Data structure and algorithm using javaData structure and algorithm using java
Data structure and algorithm using java
 
Er model ppt
Er model pptEr model ppt
Er model ppt
 
Linear search-and-binary-search
Linear search-and-binary-searchLinear search-and-binary-search
Linear search-and-binary-search
 
heap Sort Algorithm
heap  Sort Algorithmheap  Sort Algorithm
heap Sort Algorithm
 
Output primitives in Computer Graphics
Output primitives in Computer GraphicsOutput primitives in Computer Graphics
Output primitives in Computer Graphics
 
Breadth First Search & Depth First Search
Breadth First Search & Depth First SearchBreadth First Search & Depth First Search
Breadth First Search & Depth First Search
 
Introduction to c++ ppt 1
Introduction to c++ ppt 1Introduction to c++ ppt 1
Introduction to c++ ppt 1
 
daa-unit-3-greedy method
daa-unit-3-greedy methoddaa-unit-3-greedy method
daa-unit-3-greedy method
 
Conditional and control statement
Conditional and control statementConditional and control statement
Conditional and control statement
 
ER-Model-ER Diagram
ER-Model-ER DiagramER-Model-ER Diagram
ER-Model-ER Diagram
 
Introduction to Array ppt
Introduction to Array pptIntroduction to Array ppt
Introduction to Array ppt
 
Relational model
Relational modelRelational model
Relational model
 
Data types in java
Data types in javaData types in java
Data types in java
 
2D transformation (Computer Graphics)
2D transformation (Computer Graphics)2D transformation (Computer Graphics)
2D transformation (Computer Graphics)
 

Similar to data structures and its importance

part 1 - intorduction data structure 2021 mte.ppt
part 1 -  intorduction data structure  2021 mte.pptpart 1 -  intorduction data structure  2021 mte.ppt
part 1 - intorduction data structure 2021 mte.ppt
abdoSelem1
 
Intro to Data Structure & Algorithms
Intro to Data Structure & AlgorithmsIntro to Data Structure & Algorithms
Intro to Data Structure & Algorithms
Akhil Kaushik
 
Iare ds lecture_notes_2
Iare ds lecture_notes_2Iare ds lecture_notes_2
Iare ds lecture_notes_2
RajSingh734307
 
Lecture 1 and 2
Lecture 1 and 2Lecture 1 and 2
Lecture 1 and 2
SaheedTundeZubairSTA
 
Lecture 1. Data Structure & Algorithm.pptx
Lecture 1. Data Structure & Algorithm.pptxLecture 1. Data Structure & Algorithm.pptx
Lecture 1. Data Structure & Algorithm.pptx
ArifKamal36
 
Algorithms and Data Structures
Algorithms and Data StructuresAlgorithms and Data Structures
Algorithms and Data Structures
sonykhan3
 
M. FLORENCE DAYANA/DATABASE MANAGEMENT SYSYTEM
M. FLORENCE DAYANA/DATABASE MANAGEMENT SYSYTEMM. FLORENCE DAYANA/DATABASE MANAGEMENT SYSYTEM
M. FLORENCE DAYANA/DATABASE MANAGEMENT SYSYTEM
Dr.Florence Dayana
 
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
babak danyal
 
Database Systems - Lecture Week 1
Database Systems - Lecture Week 1Database Systems - Lecture Week 1
Database Systems - Lecture Week 1
Dios Kurniawan
 
Data structure and algorithm.
Data structure and algorithm. Data structure and algorithm.
Data structure and algorithm.
Abdul salam
 
Unit 2 DATABASE ESSENTIALS.pptx
Unit 2 DATABASE ESSENTIALS.pptxUnit 2 DATABASE ESSENTIALS.pptx
Unit 2 DATABASE ESSENTIALS.pptx
Nirmalavenkatachalam
 
DBMS Full.ppt
DBMS Full.pptDBMS Full.ppt
DBMS Full.ppt
pritikanamaity600
 
Data structures and algorithms Module-1.pdf
Data structures and algorithms Module-1.pdfData structures and algorithms Module-1.pdf
Data structures and algorithms Module-1.pdf
DukeCalvin
 
DSA 1- Introduction.pdf
DSA 1- Introduction.pdfDSA 1- Introduction.pdf
DSA 1- Introduction.pdf
AliyanAbbas1
 
System analysis and design
System analysis and designSystem analysis and design
System analysis and design
RobinsonObura
 
Analysis of Algorithms_RR.pptx
Analysis of Algorithms_RR.pptxAnalysis of Algorithms_RR.pptx
Analysis of Algorithms_RR.pptx
KarthikR780430
 
Algorithms-Flowcharts-Data-Types-and-Pseudocodes.pptx
Algorithms-Flowcharts-Data-Types-and-Pseudocodes.pptxAlgorithms-Flowcharts-Data-Types-and-Pseudocodes.pptx
Algorithms-Flowcharts-Data-Types-and-Pseudocodes.pptx
RobertCarreonBula
 
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
 
Lesson 1 - Data Structures and Algorithms Overview.pdf
Lesson 1 - Data Structures and Algorithms Overview.pdfLesson 1 - Data Structures and Algorithms Overview.pdf
Lesson 1 - Data Structures and Algorithms Overview.pdf
LeandroJrErcia
 
Lect 1-2 Zaheer Abbas
Lect 1-2 Zaheer AbbasLect 1-2 Zaheer Abbas
Lect 1-2 Zaheer Abbas
Information Technology Center
 

Similar to data structures and its importance (20)

part 1 - intorduction data structure 2021 mte.ppt
part 1 -  intorduction data structure  2021 mte.pptpart 1 -  intorduction data structure  2021 mte.ppt
part 1 - intorduction data structure 2021 mte.ppt
 
Intro to Data Structure & Algorithms
Intro to Data Structure & AlgorithmsIntro to Data Structure & Algorithms
Intro to Data Structure & Algorithms
 
Iare ds lecture_notes_2
Iare ds lecture_notes_2Iare ds lecture_notes_2
Iare ds lecture_notes_2
 
Lecture 1 and 2
Lecture 1 and 2Lecture 1 and 2
Lecture 1 and 2
 
Lecture 1. Data Structure & Algorithm.pptx
Lecture 1. Data Structure & Algorithm.pptxLecture 1. Data Structure & Algorithm.pptx
Lecture 1. Data Structure & Algorithm.pptx
 
Algorithms and Data Structures
Algorithms and Data StructuresAlgorithms and Data Structures
Algorithms and Data Structures
 
M. FLORENCE DAYANA/DATABASE MANAGEMENT SYSYTEM
M. FLORENCE DAYANA/DATABASE MANAGEMENT SYSYTEMM. FLORENCE DAYANA/DATABASE MANAGEMENT SYSYTEM
M. FLORENCE DAYANA/DATABASE MANAGEMENT SYSYTEM
 
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
 
Database Systems - Lecture Week 1
Database Systems - Lecture Week 1Database Systems - Lecture Week 1
Database Systems - Lecture Week 1
 
Data structure and algorithm.
Data structure and algorithm. Data structure and algorithm.
Data structure and algorithm.
 
Unit 2 DATABASE ESSENTIALS.pptx
Unit 2 DATABASE ESSENTIALS.pptxUnit 2 DATABASE ESSENTIALS.pptx
Unit 2 DATABASE ESSENTIALS.pptx
 
DBMS Full.ppt
DBMS Full.pptDBMS Full.ppt
DBMS Full.ppt
 
Data structures and algorithms Module-1.pdf
Data structures and algorithms Module-1.pdfData structures and algorithms Module-1.pdf
Data structures and algorithms Module-1.pdf
 
DSA 1- Introduction.pdf
DSA 1- Introduction.pdfDSA 1- Introduction.pdf
DSA 1- Introduction.pdf
 
System analysis and design
System analysis and designSystem analysis and design
System analysis and design
 
Analysis of Algorithms_RR.pptx
Analysis of Algorithms_RR.pptxAnalysis of Algorithms_RR.pptx
Analysis of Algorithms_RR.pptx
 
Algorithms-Flowcharts-Data-Types-and-Pseudocodes.pptx
Algorithms-Flowcharts-Data-Types-and-Pseudocodes.pptxAlgorithms-Flowcharts-Data-Types-and-Pseudocodes.pptx
Algorithms-Flowcharts-Data-Types-and-Pseudocodes.pptx
 
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
 
Lesson 1 - Data Structures and Algorithms Overview.pdf
Lesson 1 - Data Structures and Algorithms Overview.pdfLesson 1 - Data Structures and Algorithms Overview.pdf
Lesson 1 - Data Structures and Algorithms Overview.pdf
 
Lect 1-2 Zaheer Abbas
Lect 1-2 Zaheer AbbasLect 1-2 Zaheer Abbas
Lect 1-2 Zaheer Abbas
 

More from Anaya Zafar

heap sort
 heap sort heap sort
heap sort
Anaya Zafar
 
Lec 2 algorithms efficiency complexity
Lec 2 algorithms efficiency  complexityLec 2 algorithms efficiency  complexity
Lec 2 algorithms efficiency complexity
Anaya Zafar
 
Link list part 2
Link list part 2Link list part 2
Link list part 2
Anaya Zafar
 
Link list part 1
Link list part 1Link list part 1
Link list part 1
Anaya Zafar
 
Dijkstra's algorithm
Dijkstra's algorithm Dijkstra's algorithm
Dijkstra's algorithm
Anaya Zafar
 
The miracle-morning
The miracle-morningThe miracle-morning
The miracle-morning
Anaya Zafar
 
How to write a meeting agenda?
How to write a  meeting agenda?How to write a  meeting agenda?
How to write a meeting agenda?
Anaya Zafar
 
How we achieve our goals
How we achieve our goalsHow we achieve our goals
How we achieve our goals
Anaya Zafar
 
Fiber optics
Fiber opticsFiber optics
Fiber optics
Anaya Zafar
 
3 d technology
3 d technology3 d technology
3 d technology
Anaya Zafar
 
Ch 22 question solution of fundamental of physics 8th edition by HRW
Ch 22  question solution of fundamental of physics 8th edition by HRWCh 22  question solution of fundamental of physics 8th edition by HRW
Ch 22 question solution of fundamental of physics 8th edition by HRW
Anaya Zafar
 
Ch 21 question solution of fundamental of physics 8th edition by HRW
Ch 21 question solution of fundamental of physics 8th edition by HRWCh 21 question solution of fundamental of physics 8th edition by HRW
Ch 21 question solution of fundamental of physics 8th edition by HRW
Anaya Zafar
 
Definition of capacitance
Definition of capacitanceDefinition of capacitance
Definition of capacitance
Anaya Zafar
 
Chapter 24-capacitance
Chapter 24-capacitanceChapter 24-capacitance
Chapter 24-capacitance
Anaya Zafar
 
Capacitance and dielectrics
Capacitance and dielectrics Capacitance and dielectrics
Capacitance and dielectrics
Anaya Zafar
 
20 electric current resistance ohms law
20 electric current resistance ohms law20 electric current resistance ohms law
20 electric current resistance ohms law
Anaya Zafar
 
Voltage, current, resistance, and ohm's law
Voltage, current, resistance, and ohm's lawVoltage, current, resistance, and ohm's law
Voltage, current, resistance, and ohm's law
Anaya Zafar
 
Role of women in development
Role of women in developmentRole of women in development
Role of women in development
Anaya Zafar
 
Application of Gauss's law
Application of  Gauss's lawApplication of  Gauss's law
Application of Gauss's law
Anaya Zafar
 
Why we need Gaussian surface in Gauss's law
Why we need Gaussian surface in Gauss's lawWhy we need Gaussian surface in Gauss's law
Why we need Gaussian surface in Gauss's law
Anaya Zafar
 

More from Anaya Zafar (20)

heap sort
 heap sort heap sort
heap sort
 
Lec 2 algorithms efficiency complexity
Lec 2 algorithms efficiency  complexityLec 2 algorithms efficiency  complexity
Lec 2 algorithms efficiency complexity
 
Link list part 2
Link list part 2Link list part 2
Link list part 2
 
Link list part 1
Link list part 1Link list part 1
Link list part 1
 
Dijkstra's algorithm
Dijkstra's algorithm Dijkstra's algorithm
Dijkstra's algorithm
 
The miracle-morning
The miracle-morningThe miracle-morning
The miracle-morning
 
How to write a meeting agenda?
How to write a  meeting agenda?How to write a  meeting agenda?
How to write a meeting agenda?
 
How we achieve our goals
How we achieve our goalsHow we achieve our goals
How we achieve our goals
 
Fiber optics
Fiber opticsFiber optics
Fiber optics
 
3 d technology
3 d technology3 d technology
3 d technology
 
Ch 22 question solution of fundamental of physics 8th edition by HRW
Ch 22  question solution of fundamental of physics 8th edition by HRWCh 22  question solution of fundamental of physics 8th edition by HRW
Ch 22 question solution of fundamental of physics 8th edition by HRW
 
Ch 21 question solution of fundamental of physics 8th edition by HRW
Ch 21 question solution of fundamental of physics 8th edition by HRWCh 21 question solution of fundamental of physics 8th edition by HRW
Ch 21 question solution of fundamental of physics 8th edition by HRW
 
Definition of capacitance
Definition of capacitanceDefinition of capacitance
Definition of capacitance
 
Chapter 24-capacitance
Chapter 24-capacitanceChapter 24-capacitance
Chapter 24-capacitance
 
Capacitance and dielectrics
Capacitance and dielectrics Capacitance and dielectrics
Capacitance and dielectrics
 
20 electric current resistance ohms law
20 electric current resistance ohms law20 electric current resistance ohms law
20 electric current resistance ohms law
 
Voltage, current, resistance, and ohm's law
Voltage, current, resistance, and ohm's lawVoltage, current, resistance, and ohm's law
Voltage, current, resistance, and ohm's law
 
Role of women in development
Role of women in developmentRole of women in development
Role of women in development
 
Application of Gauss's law
Application of  Gauss's lawApplication of  Gauss's law
Application of Gauss's law
 
Why we need Gaussian surface in Gauss's law
Why we need Gaussian surface in Gauss's lawWhy we need Gaussian surface in Gauss's law
Why we need Gaussian surface in Gauss's law
 

Recently uploaded

PIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf IslamabadPIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf Islamabad
AyyanKhan40
 
Assessment and Planning in Educational technology.pptx
Assessment and Planning in Educational technology.pptxAssessment and Planning in Educational technology.pptx
Assessment and Planning in Educational technology.pptx
Kavitha Krishnan
 
MARY JANE WILSON, A “BOA MÃE” .
MARY JANE WILSON, A “BOA MÃE”           .MARY JANE WILSON, A “BOA MÃE”           .
MARY JANE WILSON, A “BOA MÃE” .
Colégio Santa Teresinha
 
How to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold MethodHow to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold Method
Celine George
 
Advanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docxAdvanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docx
adhitya5119
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
TechSoup
 
PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.
Dr. Shivangi Singh Parihar
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
Jean Carlos Nunes Paixão
 
A Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdfA Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdf
Jean Carlos Nunes Paixão
 
Types of Herbal Cosmetics its standardization.
Types of Herbal Cosmetics its standardization.Types of Herbal Cosmetics its standardization.
Types of Herbal Cosmetics its standardization.
Ashokrao Mane college of Pharmacy Peth-Vadgaon
 
How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17
Celine George
 
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
Nguyen Thanh Tu Collection
 
writing about opinions about Australia the movie
writing about opinions about Australia the moviewriting about opinions about Australia the movie
writing about opinions about Australia the movie
Nicholas Montgomery
 
Digital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments UnitDigital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments Unit
chanes7
 
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptxC1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
mulvey2
 
South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)
Academy of Science of South Africa
 
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdfANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
Priyankaranawat4
 
DRUGS AND ITS classification slide share
DRUGS AND ITS classification slide shareDRUGS AND ITS classification slide share
DRUGS AND ITS classification slide share
taiba qazi
 
Life upper-Intermediate B2 Workbook for student
Life upper-Intermediate B2 Workbook for studentLife upper-Intermediate B2 Workbook for student
Life upper-Intermediate B2 Workbook for student
NgcHiNguyn25
 
World environment day ppt For 5 June 2024
World environment day ppt For 5 June 2024World environment day ppt For 5 June 2024
World environment day ppt For 5 June 2024
ak6969907
 

Recently uploaded (20)

PIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf IslamabadPIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf Islamabad
 
Assessment and Planning in Educational technology.pptx
Assessment and Planning in Educational technology.pptxAssessment and Planning in Educational technology.pptx
Assessment and Planning in Educational technology.pptx
 
MARY JANE WILSON, A “BOA MÃE” .
MARY JANE WILSON, A “BOA MÃE”           .MARY JANE WILSON, A “BOA MÃE”           .
MARY JANE WILSON, A “BOA MÃE” .
 
How to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold MethodHow to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold Method
 
Advanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docxAdvanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docx
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
 
PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
 
A Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdfA Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdf
 
Types of Herbal Cosmetics its standardization.
Types of Herbal Cosmetics its standardization.Types of Herbal Cosmetics its standardization.
Types of Herbal Cosmetics its standardization.
 
How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17
 
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
 
writing about opinions about Australia the movie
writing about opinions about Australia the moviewriting about opinions about Australia the movie
writing about opinions about Australia the movie
 
Digital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments UnitDigital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments Unit
 
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptxC1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
 
South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)
 
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdfANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
 
DRUGS AND ITS classification slide share
DRUGS AND ITS classification slide shareDRUGS AND ITS classification slide share
DRUGS AND ITS classification slide share
 
Life upper-Intermediate B2 Workbook for student
Life upper-Intermediate B2 Workbook for studentLife upper-Intermediate B2 Workbook for student
Life upper-Intermediate B2 Workbook for student
 
World environment day ppt For 5 June 2024
World environment day ppt For 5 June 2024World environment day ppt For 5 June 2024
World environment day ppt For 5 June 2024
 

data structures and its importance

  • 2. Introduction • Course outline • Rules and regulations • Course contents • Good Programming Practices • Data Types and Data Structures • ADT
  • 3. Course Description • Title: Data Structures and Algorithms • Code: CMP-210 • Credit Hours:3 • Prerequisite: OOP • Follow Up: Design and Analysis of Algorithms
  • 4. Contents • Introduction to Algorithms • Arrays • Stacks • Recursion • Queues • Lists and its variations • Trees • Hashing • Searching and sorting Techniques • Graphs
  • 5. Good Programming Practices • Programs and subprograms should be well structured. Use a modular approach for a complex problem. Use the basic control structures when developing each code segment. Sequence, selection, repetition Use local variables within subprograms. Use parameters to pass information to and from subprograms. Avoid global Variables. • All source code should be documented.  Each program should include opening documentation.  Each subprogram should be documented in a manner similar to programs.  Comments should be used to explain key code segments and / or segments whose purpose or design is not obvious.  Use meaningful identifiers.
  • 6. Good Programming Practices • Source code should be aesthetic; it should be formatted in a style that enhances its readability. Put each statement of the program on a separate line. Use uppercase and lowercase letters in a way that contributes to program readability. Put each {and} on separate lines. Align each {and corresponding}. When a statement is continued from one line to another, indent the continued line(s). Align the identifiers in each constant and variable declaration, placing each on a separate line. Insert blank lines between declarations and statements and between blocks of statements to make clear the structure of the program.
  • 7. Data Types In computer programming, a data type is a classification identifying one of various types of data, such as floating-point,.. • Simple (basic) – char, int, float, double • Modifiers – signed, unsigned • Qualifiers – static, const, volatile, void • Structured (derived) – Arrays, structures, unions, classes • Advanced (composite) – List, queues, stacks, trees, graphs
  • 8. Data Structures and algorithms • Algorithms – Outline, the essence of a computational procedure, step by step instruction • Program – An implementation of an algorithm in some computer programming languages • Data Structures – Goal: organize data – Criteria: facilitate efficient • storage of data • Retrieval/recovery of data • Operation/manipulation of data • Process: – select and design appropriate data types Data may be organized in many different ways. the logical and mathematical model of a particular organization of data is called Data structure
  • 9. Need for Data Structures  Data structures organize data  more efficient programs.  More powerful computers  more complex applications.  More complex applications demand more calculations.
  • 10. Organizing Data  Any organization for a collection of records that can be searched, processed in any order, or modified.  The choice of data structure and algorithm can make the difference between a program running in a few seconds or many days.
  • 11. Efficiency  A solution is said to be efficient if it solves the problem within its resource constraints. – Space – Time  The cost of a solution is the amount of resources that the solution consumes.
  • 12. Selecting a Data Structure Select a data structure as follows: 1. Analyze the problem to determine the resource limitations a solution must meet. 2. Determine the basic operations that must be supported. Count the resource limitations for each operation. 3. Select the data structure that best meets these requirements.
  • 13. Examples Searching an online phone directory: Linear search? OK for small organizations too slow for large ones  Amount of data is an important factor. Compiler lookup of an identifier's type, etc. in a symbol table: Linear search? No, too slow Binary search? No, too much work to keep sorted  Number of accesses & speed required is an important factor. Use hash tables Text processing: Store in an array / vector? OK for text analysis — word counts, average word length, etc. Not for word-processing — Too inefficient if many insertions & deletions    Static vs. dynamic nature of the data is an important factor
  • 14. Abstract Data Type (ADT) • Abstraction – Separating data from operation – Generalization – a concept or idea not associated with any specific instance • ADT(Abstract Data Type) – A collection of related data items together with basic operations between them and operations to be performed on them – A data type is a collection of values and set of operation on those values • values and operation that are implemented using a hardware or software data structure
  • 15. abstract data type (ADT) a collection of related data items together with an assoicated set of operations e.g. whole numbers (integers) and arithmetic operators for addition, subtraction, multiplication and division. Why "abstract?" Data, operations, and relations are studied independent of implementation. What not how is the focus.
  • 16. implementation of an ADT consists of storage structures (aka data structures) to store the data items and algorithms for the basic operations and relations. The storage structures/data structures used in implementation are provided in a language (primitive or built-in) or built from the language constructs (user-defined). In either case, successful software design uses data abstraction: Separating the definition of a data type from its implementation.
  • 17. Goals of this Course 1. Reinforce the concept that costs and benefits exist for every data structure. 2. Learn the commonly used data structures. – These form a programmer's basic data structure “toolkit”. 3. Understand how to measure the cost of a data structure or program. – These techniques also allow you to judge the merits of new data structures that you or others might invent.