

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


Week 2
Readings:
Objectives:
Concepts:
Outline:
1. Introduction a. Getting Started b. Foundation of Algorithms 2. The Role of Algorithms in Computing a. Algorithms b. Algorithms as a technology 3. Growth of Functions a. Asymptotic Notation b. Standard notations and common functions **4. Elementary Data Structures- Working with Arrays
Reference:
1. http://en.wikibooks.org/wiki/Data_Structures/Asymptotic_Notation 2. Introduction to Algorithms, 2nd^ Edition, Thomas H. Corme 3. http://en.wikibooks.org/wik/Data_Structures
CS 331: Week 2ā Lecture Notes
1. Introduction
a. Getting Started Algorithms: It can be defined as a well defined computational procedure that solves a problem
b. Foundation of Algorithms Takes input(s) and produces output(s) A sequence of steps that transform the input into the output
2. The Role of Algorithms in Computing
a. Algorithms An algorithm is essence of any computer program
b. Algorithms as a technology Role of algorithms relative to other technologies in computing is more important. A well-written algorithm can help in design of a program that excels in: Correctness Amount of work done (efficiency) Amount of space used Simplicity, clarity Optimality
3. Growth of Functions
Asymptotic Notation ļ§ Introduction: o Asymptotic means a line that tends to converge to a curve, which may or may not eventually touch the curve. o It's a line that stays within bounds. o Asymptotic notation is a shorthand way to write down and talk about 'fastest possible' and 'slowest possible' running times for an algorithm, using high and low bounds on speed. Big O Notation: Big-O is the formal method of expressing the upper bound of an algorithm's running time. ļ§ Definition: More formally, for non-negative functions, f(n) and g(n) , if there exists an integer n 0 and a constant c > 0 such that for all integers n > n 0 , f(n) ⤠cg(n) , then f(n) is Big O of g(n). This is denoted as " f(n) = O(g(n)) ". ļ§ Theory Examples : Say that f(n) = 2n + 8, and g(n) = n^2. Can we find a constant c, so that 2n + 8 <= n^2? ļ§ Little-O Notation: For non-negative functions, f(n) and g(n) , f(n) is little o of g(n) if and only if f(n) = O(g(n)) , but f(n) ā Ī(g(n)). This is denoted as " f(n) = o(g(n)) ".This represents a loose bounding version of Big O.