Professional Documents
Culture Documents
&
Algorithms
1
Data Structures (how to organize data) and
Algorithms (how to manipulate data) are
the cores of today’s computer
programming
2
Data Structures + Algorithms = Programs
3
Why algorithm analysis?
4
Choosing an Algorithm
Performance requirements
– Time complexity
Memory requirements
– Space complexity
5
Space Complexity
Instruction space
Data space
Environment stack space
6
Time Complexity
Will the algorithm gives a satisfactory real-
time response
7
Big Oh Notation:
If f(n) and g(n) are functions defined on
positive integer number n, then
f(n) = O(g(n)),
if there exists positive constants c and
n0, such that f(n) < = c* g(n) for all values
of n > = n0
8
Why data structures?
9
Basic Terminology
Data
– Refers to a value or set of values
Data Item
– Refers to a single unit of values
Entity
– An Entity is something that has certain attributes or
properties which may be assigned values
Entity Set
– An entity set is a collection of similar entities
10
Cont:
Record
– It is a collection of related records
File
– It is a collection of related records
Key
– Primary key
– Alternate key
– Composite key
Information
– It is a processed data
11
Data type
A data type is a collection of values and a
set of operations that act on those values
Types
– Primitive data type
• Data types that are predefined
– Abstract data type
• Abstraction + the operations that can be done on
them
12
Data Structures
It is a logical model of a particular
organization of data.
Study includes
– Logical description of the data structures
– Implementation of the data structures
– Quantitative analysis of the data structures
13
Importance of Data Structures
14
Various Data Structures
15