04 Abstract Data Types and Pointers
CJD
Data Structures
Data are pieces of information stored in a computer
and manipulated by programs.
Data structures are organized representations that
aim to show relationships among data items.
Our objective is to fi

01 Algorithms
CJD
Definition
An ALGORITHM is
a finite set of precise instructions for
performing a computation or for solving a
problem.
a well-defined computational procedure that
takes some value(s) as input, and produces or
transforms the input into

06 Stacks
CJD
Stacks
Pushdown Stack a linear data structure that
can be accessed only at one of its ends for storing
and retrieving data. This end is called the top of
the stack.
Principle : LIFO (Last-In First-Out)
Example: Cafeteria Trays
In Java, use j

03 Searching and Sorting
CJD
Finding the Maximum
maximum( A[1.n] )
1 max A[1]
2 for i 2 to n
3
if max < A[i]
4
then max A[i]
5 return max
/ initial maximum
/ new maximum
Example:
1
A
2
3
4
5
6
7
8
9
A
L
G
O
R
I
T
H
M
returns T
CJD
maximum Efficiency
Best

02 Computational
Complexity
CJD
Empirical Program Efficiency
How is a programs actual efficiency
measured?
Run the program and measure its
Running TIME
the time required for a computer to execute a
program
depends on the CPU, Memory, Input size, kind

05 Linked Lists
CJD
Lists
List : A sequence of items
Arrays :
data structure provided in programming languages
a contiguous block of memory is allocated, so each
element can be accessed randomly in constant time.
Array Limitations :
Changing the siz