CSS106 Introduction to Elementary Algorithms M.Sc Askar Satabaldiyev
What is an “algorithm”?
algorithm(noun): a set of steps to accomplish a task
Go to bus station
Take a bus
Go to bus station Take a bus Go to university
Go to bus station Take a bus Go to university (!)
Slice bread
Apply cheese
Slice bread Apply cheese Get your cheese toast
Computer Science algorithms
Start with an input data
Do complex calculations
Start with an input data Do complex calculations Stop when we find answer
Computer Science
a few examples…
Compression algorithms
Finding optimal route algorithms
rendering algorithms
Optimization and scheduling algorithms
Which algorithms will you use?
Make your programs FASTER
Which algorithms could you CREATE?
Big Data Analysis
What makes a good algorithm?
What makes a good algorithm? 1. Correctness 2. Efficiency
Asymptotic Analysis #nodesNearest insertion Brute force … N2N2 N!
k = 0; for (i = 1; i <= N; i++) if (N % i == 0) k++; return k == 2; for (i = 2; i < n; i++) if(N % i == 0) return false; return true; another method… for (i = 2; i < sqrt(n); i++) if(N % i == 0) return false; return true; Which one is faster?
Grading Policy
Attendance 10% Midterm Exam 20% Assignment 15% Homework 15% Quizes 10% Final Exam 30% Contests/Codeforces/Bonus 20% Total 100%(+20?) Grading Policy
Intro to algorithms 01.Sept – 04.Sept Binary Search/Asymptotic notations 07.Sept – 11.Sept Selection sort/Insertion sort 15.Sept – 18.Sept Recursive algorithms 22.Sept – 25.Sept Towers of Hanoi/Merge Sort/Quick sort 29.Sept – 02.Oct Graph Representation 05.Oct – 09.Oct Breadth-first search 12.Oct – 16.Oct Midterm Exam 19.Oct – 23.Oct Upcoming Topics