Professional Documents
Culture Documents
Data Structures and Algorithms
Data Structures and Algorithms
and Algorithms
Introduction
What is Data?
What is Data?
“…data is a collection of discrete values that
convey information, describing quantity,
quality, fact, statistics, other basic units of
meaning, or simply sequences of symbols
that may be further interpreted…”
What is Data Type?
What is Data Type?
Has 2 Types
1. Primitive
2. Composite/Derived
Primitive Data Types
+A basic data type
+Character
+Integer
+Floating-Point Number
+Fixed-Point Number
Composite Data Types
+Array
+Pointers
+Structures
+Unions
+String
Heap vs. Stack
Introduction to Data Structures
Stack vs. Heap
STACK
SUM = 80.89
I = 10
Heap
STACK HEAP
TREE GRAPH
Looking in to Arrays
Array
A collection of elements – (usually a collection of
elements with the same type, depending on the
language used)
Example on a String
A String
Is a collection/sequence of characters.
“Hello World!”
A String
H E L L O W O R L D !
0 1 2 3 4 5 6 7 8 9 10 11
Example
Array/List
- Collection of elements
INDEX 0 1 2 3
INDEX 0 1 2 3
struct {
int day;
int month;
int year;
}
Object
Can be a variable, function, method, etc. Mostly used in Object-
Oriented Paradigm and defined by use of keyword class (in
most programming languages)
class person:
name: string = “”
def __init__(self):
pass
Data Structures are used for…
Managing
Storing Data Resources and Data Exchange
Services
Ordering and
Indexing Scalability
Sorting
Choosing Data Structure