Big O notation Big O notation is used in Computer Science to describe the performance or complexity of an algorithm. Big O specifically describes the worst-case.

Slides:



Advertisements
Similar presentations
College of Information Technology & Design
Advertisements

The Efficiency of Algorithms Chapter 4 Copyright ©2012 by Pearson Education, Inc. All rights reserved.
Fall 2006CENG 7071 Algorithm Analysis. Fall 2006CENG 7072 Algorithmic Performance There are two aspects of algorithmic performance: Time Instructions.
CS 263.  Classification of algorithm against a model pattern ◦ Each model demonstrate the performance scalability of an algorithm  Sorting algorithms.
Algorithm Efficiency and Sorting Bina Ramamurthy CSE116A,B.
Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved Chapter 23 Algorithm Efficiency.
Analysis of Algorithm.
1 Section 2.3 Complexity of Algorithms. 2 Computational Complexity Measure of algorithm efficiency in terms of: –Time: how long it takes computer to solve.
 2006 Pearson Education, Inc. All rights reserved Searching and Sorting.
Algorithm Analysis (Big O)
February 17, 2015Applied Discrete Mathematics Week 3: Algorithms 1 Double Summations Table 2 in 4 th Edition: Section th Edition: Section th.
Asymptotic Notations Iterative Algorithms and their analysis
Liang, Introduction to Java Programming, Seventh Edition, (c) 2009 Pearson Education, Inc. All rights reserved Chapter 23 Algorithm Efficiency.
Introduction to complexity Prof. Sin-Min Lee Department of Computer Science San Jose State University.
1 Chapter 24 Developing Efficient Algorithms. 2 Executing Time Suppose two algorithms perform the same task such as search (linear search vs. binary search)
1 Recursion Algorithm Analysis Standard Algorithms Chapter 7.
Analysis of Algorithms
Big Oh Algorithms are compared to each other by expressing their efficiency in big-oh notation Big O notation is used in Computer Science to describe the.
Analysis of Algorithms CSCI Previous Evaluations of Programs Correctness – does the algorithm do what it is supposed to do? Generality – does it.
Program Efficiency & Complexity Analysis. Algorithm Review An algorithm is a definite procedure for solving a problem in finite number of steps Algorithm.
Chapter 10 Algorithm Analysis.  Introduction  Generalizing Running Time  Doing a Timing Analysis  Big-Oh Notation  Analyzing Some Simple Programs.
Geoff Holmes and Bernhard Pfahringer COMP206-08S General Programming 2.
Computer Science and Software Engineering University of Wisconsin - Platteville 8. Comparison of Algorithms Yan Shi CS/SE 2630 Lecture Notes Part of this.
Chapter 5 Algorithms (2) Introduction to CS 1 st Semester, 2015 Sanghyun Park.
Algorithm Analysis Problem Solving Space Complexity Time Complexity
Algorithm Analysis Part of slides are borrowed from UST.
1 5. Abstract Data Structures & Algorithms 5.6 Algorithm Evaluation.
Search Algorithms Written by J.J. Shepherd. Sequential Search Examines each element one at a time until the item searched for is found or not found Simplest.
Questions 4) What type of algorithmic problem-solving technique (greedy, divide-and-conquer, dynamic programming)
WHICH SEARCH OR SORT IS BETTER?. COMPARING ALGORITHMS Time efficiency refers to how long it takes an algorithm to run Space efficiency refers to the amount.
Complexity of Algorithms Fundamental Data Structures and Algorithms Ananda Guna January 13, 2005.
Algorithms April-May 2013 Dr. Youn-Hee Han The Project for the Establishing the Korea ㅡ Vietnam College of Technology in Bac Giang.
Algorithm Analysis. Question 1  "My program finds all the primes between 2 and 1,000,000,000 in 1.37 seconds." –how good is this solution? A.Good B.Bad.
1 5. Abstract Data Structures & Algorithms 5.6 Algorithm Evaluation.
LECTURE 9 CS203. Execution Time Suppose two algorithms perform the same task such as search (linear search vs. binary search) and sorting (selection sort.
Algorithm Analysis 1.
CS 302 Data Structures Algorithm Efficiency.
19 Searching and Sorting.
Sorting and "Big Oh" ASFA AP Computer Science A SortingBigOh.
Applied Discrete Mathematics Week 2: Functions and Sequences
Analysis of Algorithms
Big-O notation Linked lists
COP 3503 FALL 2012 Shayan Javed Lecture 15
Searching – Linear and Binary Searches
Introduction to complexity
Analysis of Algorithms
Big-O notation.
Lesson Objectives Aims Understand the following: The big O notation.
CMPT 120 Topic: Searching – Part 1
Introduction to Algorithms
Teach A level Computing: Algorithms and Data Structures
Enough Mathematical Appetizers!
Computation.
Analysis of Algorithms
Efficiency (Chapter 2).
Algorithm Analysis (not included in any exams!)
Algorithm design and Analysis
Algorithm An algorithm is a finite set of steps required to solve a problem. An algorithm must have following properties: Input: An algorithm must have.
Big O Notation.
Comparing Algorithms Unit 1.2.
Applied Discrete Mathematics Week 6: Computation
Analysis of Algorithms
Algorithm Analysis Bina Ramamurthy CSE116A,B.
Analyzing an Algorithm Computing the Order of Magnitude Big O Notation
Enough Mathematical Appetizers!
8. Comparison of Algorithms
IST311 - CIS265/506 Cleveland State University – Prof. Victor Matos
Enough Mathematical Appetizers!
Analysis of Algorithms
Presentation transcript:

Big O notation Big O notation is used in Computer Science to describe the performance or complexity of an algorithm. Big O specifically describes the worst-case scenario, and can be used to describe the execution time required or the space used (e.g. in memory or on disk) by an algorithm. Visit for more Learning Resources

O(1) O(1) describes an algorithm that will always execute in the same time (or space) regardless of the size of the input data set. O(N) O(N) describes an algorithm whose performance will grow linearly and in direct proportion to the size of the input data set. Big O notation will always assume the upper limit where the algorithm will perform the maximum number of iterations. O(N2) O(N2) represents an algorithm whose performance is directly proportional to the square of the size of the input data set. This is common with algorithms that involve nested iterations over the data set. Deeper nested iterations will result in O(N3), O(N4) etc.

O(2N) O(2N) denotes an algorithm whose growth doubles with each addition to the input data set. An example of an O(2N) function is the recursive calculation of Fibonacci numbers: O(log N). The iterative halving of data sets described in the binary search example produces a growth curve that peaks at the beginning and slowly flattens out as the size of the data sets increase e.g. an input data set containing 10 items takes one second to complete, a data set containing 100 items takes two seconds, and a data set containing 1000 items will take three seconds.