Lecture 01 IntroductionToAlgorithm
Lecture 01 IntroductionToAlgorithm
SC1006
Computer
SC1007 Organisation &
SC2000 SC1004
Data Structures &
Probability Linear Algebra Architecture
Algorithms
Statistic for for Computing
Computing
SC2002 SC2005
SC2001 SC2207 SC2006 Operating
Algorithm Design Introduction Object Oriented
Software Systems
SC2008 Design &
& Analysis to Databases Engineering
Computing Networks Programming
SC3010
SC3000 SC3020 Computer
SC3030 Artificial Database System Security
Advanced Intelligence Principles
Computer Networks
Session Objectives
• Lectures focus on introduction to concepts
• Tutorials focus on understanding the concepts, discussion and doubt
clarification
• Lab sessions and assignments focus on practice
• Lab tests and quiz are assessments
Overview of SC1007
Data Structures:
• Concepts of pointers and structures (aggregates)
• Introduce some classical data structures
• Linear: Linked list, stack, queue
• Non-linear: tree
• Implement these data structures
Algorithms:
• Analysis of Algorithm – time complexity and space complexity
• Introduce to some typical algorithms and their applications
• Introduce to some algorithm design strategies
Implementation:
• C programming
Overview
• What is an algorithm?
• Problem types in computing
• Algorithm design strategies
Algorithm
• Appear in Webster’s New World Dictionary
after 1957
• It is derived from the name of a Persian
Mathematician in the 9th century.
• Euclidean algorithm for finding the greatest
common divisor of two numbers – Euclid’s
Elements (300B.C.)
https://en.wikipedia.org/wiki/Algorithm
Knuth’s The Art of Computer Programming
Algorithm
• An algorithm is a sequence of unambiguous instructions for solving a
problem, i.e., for obtaining a required output for any legitimate input
in a finite amount of time.
Introduction to The Design & Analysis of Algorithms
-Anany Levitin
• An algorithm is any well-defined computational procedure that takes
some value, or set of values, as input and produces some value, or set
of values, as output.
Introduction to Algorithms
-T. H. Cormen et. al.
Algorithm
• Correctness:
• Output results must be correct and consistent for every given input instance
• Precision:
• A series of well-defined and systematic steps
• The steps should not contain any ambiguous word like maybe, roughly, about
etc.
• Finiteness:
• Terminates in a finite number of instructions
Algorithm VS Program
• A computer program is an instance, or concrete representation of an
algorithm in some programming languages.
Algorithm
7 15 77 1 20 32 19 53
Dick Hash .. …
… …
Harry
.. ..
Sudoku .. ..
Graph Problems 4 12
A graph is a mathematical structure consisting of a 11
collection of vertices and edges. 1
8
Each edge has one or two vertices associated to it. 3
2
5 6 7
9 10
https://forio.com/app/showcase/route-optimizer/
Path Finding Traveler Salesman Problem
Combinatorial Problems
• The study of arrangements, patterns, designs, assignments schedules,
connections and configurations.
• Cryptography:
• Information Transmission
Message Encoder Decoder Message
Harry Polishing
7 15 77 1 20 32 19 53 19.5
M I C R O
• Finding the shortest path between two points in a planar graph with
obstacles
• Constructing a Delaunay triangulation Computing the area of a polygon or
the volume of a polyhedron
• Detecting and resolving collisions between objects in a 2D or 3D space
Numerical Problem and Optimization Problem
• Use numerical approximation for the mathematical analysis
• Widely used for solving problems of engineering and mathematical models
• Newton’s method
• Gaussian elimination
• Linear programming is an optimization technique for a system of linear
constraints and a linear objective function
min 3𝑥 + 5𝑦
subject to 5𝑥 + 3𝑦 ≥ 29
−2𝑥 + 𝑦 ≤ 6
2𝑥 + 5𝑦 ≤ 66
7𝑥 − 4𝑦 ≤ 16
How do we solve these problems?
How do we solve these problems?