CS 3303-01 Data Structures - AY2022-T5
Dashboard My courses CS 3303-01 - AY2022-T5 23 June - 29 June Learning Guide Unit 2
Learning Guide Unit 2 Unit 2 Learning Guide Overview
Unit 2: Algorithm Analysis
Topics: Best, worst, and average cases for algorithm performance : Asymptotic analysis oUpper and Lower Bounds oBig O, Big Omega, and Big Theta notation Determining the running time of an algorithm Learning Objectives: Understand and be able to apply basic concepts of Asymptotic analysis Recognize the cost /benefit tradeoffs that are inherent in the design of algorithms and the role of Asymptotic analysis to understand those characteristics in specific algorithms and data structures Be able to determine the best, worst, and average case performance of a particular algorithm and be able to identify and articulate for any algorithm o The upper bound in Big O (O) notation for the algorithm o The lower bound in Big Omega () notation for the algorithm o The notation used when the upper and lower bounds are the same which is the Big Theta (O) notation for the algorithm Recognize and be able to apply the simplifying rules outlined in section 3.4.4 of the Shaffer text.
Learning Guide Unit 2
Unit 2 Learning Guide
Reading Assignment
Required Chapter 3: Algorithm Analysis in A Practical Introduction to Data Structures and Algorithm Analysis by Clifford A. Shaffer.
Supplemental Video Lectures MIT (Analysis of Algorithms Video Lecture Part 1) URL : http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-046j introduction-to-algorithms-sma-5503-fall-2005/video-lectures/lecture-1-administrivia- introduction-analysis-of-algorithms-insertion-sort-mergesort/ MIT (Analysis of Algorithms Video Lecture Part 2) URL: https://ocw.mit.edu/courses/6-046j-introduction-to-algorithms-sma-5503-fall- 2005/resources/lecture-2-asymptotic-notation-recurrences-substitution-master-method/
Discussion Assignment
For the following problems, develop your own answers and post your answers to the discussion forum. Review the responses of at least 3 of your peers. If you find that your peer has come up with a different answer than your own, engage your peer in a dialogue to compare notes' to determine where the problem lies.
If you have discovered a different way of understanding the problem or solving the problem share your approach with your peers. The objective of this assignment is to collaboratively learn and develop correct results for each of the problems. Asymptotic analysis is a difficult concept to master as such we will all benefit by understanding each others perspectives.
1. Suppose that algorithm A takes 1000n3 steps and algorithm B takes 2" steps for a problem of size n. For what size of problem is algorithm A faster than B (meaning algorithm A has fewer steps than B)? In your answer describe not only what the answer is but how you arrived at the answer.
2. Give the upper bound (big O notation) that you can for the following code fragment, as a function of the initial value of n.
for(int i = 0; i< n; i++){ for(int j= 0; j< i; j++){ //do swap stuff, constant time
Do you think that the lower bound is likely to be the same as the answer you gave for the upper bound? In your response state why or why not.
Lea