Hash Table
A hash table is a data structure storing keys / data in an
indexed table
In other words, index is a function of the data to be inserted
Operations:
Insertion
Search
Deletion
Topic 8
~ Hashing
Performance:
O(1) on average for each operation
Prep

Graphs
A graph is a way to represent relationships between entities
A graph G consists of a set of node / vertices, denoted as V and
a set of edges, denoted as E
Number of nodes = |V| or n
Number of edges = |E| or e
Two types of graphs:
Topic 7
~ Graphs
U

Introduction
Binary Search Trees provide
O(logn) searching provided that
the nodes are being placed in
balanced manner
However, this is not always the
case as insertion and deletion of
tree nodes will generally make
the resulting trees unbalanced
In the w

Sorting Algorithms
Sorting algorithms refer to algorithms that arrange elements of a
list in non-decreasing order, i.e. each element is no smaller than
previous element
Categories:
Comparison-based sorting
Selection sort
Insertion sort
Merge sort
Quick so

Lower Bound of Comparison-based Sorting
All the sorting algorithms covered
so far are all based on element
comparison, i.e.
They sort by doing comparisons
between pairs of elements
It is interesting to derive the
lower bound on the running time
(i.e. numb

What is Algorithm?
Recall, an algorithm is a clearly
specified set of simple instructions
for solving a problem
It can be specified using Problem example:
Calculate discount-rate
Flowchart
Pseudo-code
Computer program
Topic 3
~ Design and Analysis of Algo

Stack and Queue
Stacks and queues are list that can
handle a collection of elements, but with
certain restrictions
Stacks:
Element can only be inserted and deleted
at one end (i.e. the top of the list)
Last inserted element will be the first
to be examine

What are Data Structures & Algorithms?
Data structure refers to the way of storing and organizing
data in a computer so that the data could be accessed and
manipulated efficiently
Algorithm is a step-by-step procedure for solving a problem
Computer Progra

Exponents
Definition:
Any expression written as an is defined as the variable a
raised to the power of the number n
n is called an exponent of a, or a power or an index of a
Useful properties:
Topic 2
~ Mathematical and Programmatic Preliminaries
Zero pow

Data Structure
Recall, data structure refers
to the way of storing and
organizing data in a
computer so that the data
could be accessed and
manipulated efficiently
To make this possible, the
following are needed for
every data structure:
Topic 4 (Part I)

Definition
A tree is a way to store data in hierarchical manner
It contains a collection of nodes with no node cycle
Topic 6 (Part I)
~ Trees
Prepared by Desmond Yau-Chat TSOI
Lecturer, Division of Applied Science and Technology, Community College of City