Outcome (2): Introduction to data structures
An Introduction to Data Structure
Terms: Data Types, Data Structures, Abstract Data Type (ADT)
- 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
- Not measure actual time (why?)
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
You need to provide a system to store a set of student records
Student No.: h02xxxxx
Hobbies: working on assignments, programming
Each record can b
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)
Outcome (1) and (3): How to analyze recursive algorithms?
Will teach an algortihm design technique.
Recurrence, recursive function, divide-and-conquer approach
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) ?
1) Directed / Undirected graph g
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.
(1) Test 2
* Dec 01 (Thur) *
* 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.