Outcome (2): Introduction to data structures
An Introduction to Data Structure
Terms: Data Types, Data Structures, Abstract Data Type (ADT)
Data Types
- provided by a programming language
- a set of values + a set of operations on these values
- e.g. int

Analysis of algorithms (Outcome (1)
Q: how good a given
Time
algorithm is?
- Not measure actual time (why?)
Recall
Two major concerns
Other issues (not our concern):
e.g. is it difficult to implement?
- Can be used to predict the
actual running time and f

Outcome (2): A useful data structure - hashing
Application
You need to provide a system to store a set of student records
Name: Peter
Student No.: h02xxxxx
Age: 20
Year: 1
Curriculum: BEng(SE)
Hobbies: working on assignments, programming
Each record can b

Balanced
AVL Tree
Binary Search
Tree
A binary search tree can perform the following
operations, Insert, Delete, Search, Minimum, Maximum,
Predecessor, Successor, in O(h) time where h is the
Review height of the tree
Aim: we want to achieve O(log n)
Worst

Outcome (1) and (3): How to analyze recursive algorithms?
Will teach an algortihm design technique.
Recurrence, recursive function, divide-and-conquer approach
Review:
A function is recursive if it is defined in terms of itself.
Let n be positive integers

Outcome (2): Another data structure - tree
Do you remember whats a graph G(V, E) ?
Tree
a
Edge
Cycle
c
b
1) Directed / Undirected graph g
d
f
e Node/vertex
h
2) A path from vi to vj: a sequence <vi, vi+1,. vj-1, vj> such
that (vk, vk+1) E (set of edges) f

Searching and Binary Search Tree (Outcome (2)
Review: lets revisit the searching problem.
Problem: Given a set of n elements and an element x, return the
location of the element x or report that such an element does not
exist in the set.
Sequential (Linea

Announcements
(1) Test 2
* Dec 01 (Thur) *
2:30pm 4:30pm
Venue: KB223
Topics:
* Everything up to and including Sorting by comparison;
emphasis on topics not in Test 1 *
(2) Programming assignment
- Any language as long as TAs know how to grade it.
- Deadl