Review I. Final exam Date TBD. Don ’ t be late! Open book, open notes No calculators or any electronics Worth 50% of final grade.

Slides:



Advertisements
Similar presentations
A simple example finding the maximum of a set S of n numbers.
Advertisements

Analysis of Algorithms
CSE 373: Data Structures and Algorithms Lecture 5: Math Review/Asymptotic Analysis III 1.
5/5/20151 Analysis of Algorithms Lecture 6&7: Master theorem and substitution method.
5/15/ Algorithms1 Algorithms – Ch4 - Divide & Conquer Recurrences: as we saw in another lecture, the Divide and Conquer approach leads to Recurrence.
September 12, Algorithms and Data Structures Lecture III Simonas Šaltenis Nykredit Center for Database Research Aalborg University
Divide-and-Conquer Recursive in structure –Divide the problem into several smaller sub-problems that are similar to the original but smaller in size –Conquer.
Chapter 4: Divide and Conquer Master Theorem, Mergesort, Quicksort, Binary Search, Binary Trees The Design and Analysis of Algorithms.
Lecture 5COMPSCI.220.FS.T Worst-Case Performance Upper bounds : simple to obtain Lower bounds : a difficult matter... Worst case data may be unlikely.
Chapter 2. Getting Started. Outline Familiarize you with the to think about the design and analysis of algorithms Familiarize you with the framework to.
Algorithms Recurrences. Definition – a recurrence is an equation or inequality that describes a function in terms of its value on smaller inputs Example.
Review. What to know You are responsible for all material covered in lecture, the readings, or the programming assignments There will also be some questions.
UMass Lowell Computer Science Analysis of Algorithms Prof. Karen Daniels Fall, 2001 Midterm Review Fri. Oct 26.
Introduction to Analysis of Algorithms
Data Structures, Spring 2004 © L. Joskowicz 1 Data Structures – LECTURE 3 Recurrence equations Formulating recurrence equations Solving recurrence equations.
Data Structures, Spring 2006 © L. Joskowicz 1 Data Structures – LECTURE 3 Recurrence equations Formulating recurrence equations Solving recurrence equations.
1 Data Structures A program solves a problem. A program solves a problem. A solution consists of: A solution consists of:  a way to organize the data.
Functional Design and Programming Lecture 4: Sorting.
Administrivia- Introduction CSE 373 Data Structures.
Design and Analysis of Algorithms – Chapter 51 Divide and Conquer (I) Dr. Ying Lu RAIK 283: Data Structures & Algorithms.
Analysis of Algorithms
Analysis of Algorithms COMP171 Fall Analysis of Algorithms / Slide 2 Introduction * What is Algorithm? n a clearly specified set of simple instructions.
© 2006 Pearson Addison-Wesley. All rights reserved10 A-1 Chapter 10 Algorithm Efficiency and Sorting.
1 CSE 417: Algorithms and Computational Complexity Winter 2001 Lecture 5 Instructor: Paul Beame TA: Gidon Shavit.
EXAM REVIEW CSC 172 SPRING 2004 LECTURE 26. Want to TA for next semester?
Unit 1. Sorting and Divide and Conquer. Lecture 1 Introduction to Algorithm and Sorting.
Data Structures and Programming.  Today:  Administrivia  Introduction to 225, Stacks  Course website: 
Algorithm Efficiency CS 110: Data Structures and Algorithms First Semester,
Analyzing Recursive Algorithms A recursive algorithm can often be described by a recurrence equation that describes the overall runtime on a problem of.
Unit III : Introduction To Data Structures and Analysis Of Algorithm 10/8/ Objective : 1.To understand primitive storage structures and types 2.To.
Copyright © 2007 Pearson Addison-Wesley. All rights reserved. A. Levitin “ Introduction to the Design & Analysis of Algorithms, ” 2 nd ed., Ch. 1 Chapter.
10/13/20151 CS 3343: Analysis of Algorithms Lecture 9: Review for midterm 1 Analysis of quick sort.
Nirmalya Roy School of Electrical Engineering and Computer Science Washington State University Cpt S 223 – Advanced Data Structures Course Review Midterm.
Lecture 2 Algorithm Analysis Arne Kutzner Hanyang University / Seoul Korea.
CMPT 438 Algorithms. Why Study Algorithms? Necessary in any computer programming problem ▫Improve algorithm efficiency: run faster, process more data,
+ David Kauchak cs312 Review. + Midterm Will be posted online this afternoon You will have 2 hours to take it watch your time! if you get stuck on a problem,
Algorithmic Analysis Charl du Plessis and Robert Ketteringham.
Big Java by Cay Horstmann Copyright © 2009 by John Wiley & Sons. All rights reserved. Selection Sort Sorts an array by repeatedly finding the smallest.
1/6/20161 CS 3343: Analysis of Algorithms Lecture 2: Asymptotic Notations.
Asymptotic Performance. Review: Asymptotic Performance Asymptotic performance: How does algorithm behave as the problem size gets very large? Running.
1 Algorithms CSCI 235, Fall 2015 Lecture 6 Recurrences.
Foundations II: Data Structures and Algorithms
CS 150: Analysis of Algorithms. Goals for this Unit Begin a focus on data structures and algorithms Understand the nature of the performance of algorithms.
Lecture 2 Algorithm Analysis Arne Kutzner Hanyang University / Seoul Korea.
Course Review Fundamental Structures of Computer Science Margaret Reid-Miller 28 April 2005.
Big O David Kauchak cs302 Spring Administrative Assignment 1: how’d it go? Assignment 2: out soon… Lab code.
 FUNDAMENTALS OF ALGORITHMS.  FUNDAMENTALS OF DATA STRUCTURES.  TREES.  GRAPHS AND THEIR APPLICATIONS.  STORAGE MANAGEMENT.
CSC 212 – Data Structures Lecture 15: Big-Oh Notation.
BITS Pilani Pilani Campus Data Structure and Algorithms Design Dr. Maheswari Karthikeyan Lecture1.
CMPT 238 Data Structures More on Sorting: Merge Sort and Quicksort.
LECTURE 2 : fundamentals of analysis of algorithm efficiency Introduction to design and analysis algorithm 1.
BITS Pilani Pilani Campus Data Structure and Algorithms Design Dr. Maheswari Karthikeyan Lecture3.
Equal costs at all levels
Subject Name: Design and Analysis of Algorithm Subject Code: 10CS43
Midterm Review.
Unit 1. Sorting and Divide and Conquer
CS 3343: Analysis of Algorithms
Lecture 4 Divide-and-Conquer
CS 3343: Analysis of Algorithms
CS 3343: Analysis of Algorithms
Introduction CSE 373 Data Structures.
Administrivia- Introduction
Midterm Review CSE116A,B.
Trevor Brown CS 341: Algorithms Trevor Brown
CSC 380: Design and Analysis of Algorithms
CSC 380: Design and Analysis of Algorithms
Administrivia- Introduction
David Kauchak cs161 Summer 2009
Design and Analysis of Algorithms
Algorithms CSCI 235, Spring 2019 Lecture 6 Recurrences
Presentation transcript:

Review I

Final exam Date TBD. Don ’ t be late! Open book, open notes No calculators or any electronics Worth 50% of final grade

Office hours TBD

Material for preparation Lecture notes: See solutions to five homeworks for what I consider clear and complete solutions. 3 final exams available online at MUSE: you need to sign-in and give the bar code number on your student card –Spring 2001 exam (Ignore page 6, page 8) –Spring 2003 exam (Ignore Q3, Q4 (polynomials)) 39 more problems at:

Topics covered No java questions; only pseudocode All other material is going to be examined, with some emphasis on post-midterm material Material not covered in homeworks (i.e. starting with undecidability) will be covered in the final, but with less emphasis

Recursion Designing recursive algorithms –Break problem into smaller subproblems of the same nature –Solve subproblems recursively –Combine solutions of subproblems into solution of large problem –Don ’ t forget your base case! Dividing original problem into roughly equal size subproblem usually gives better running times –Power (lecture7) vs power (hw2) –slowMergeSort (midterm) vs mergeSort –quickSort (good pivot choice) vs quickSort (bad pivot) –integer multiplication Tracing recursion (like in hw4)

Recursion Trees: recursion usually easier (try isIsomorphic without recursion!) Analysis of running time of recursive algorithms –Writing recurrences for T(n) –Solving recurrences using substitution method or recursion tree method. –Master theorem can only be user for T(n) = a T(n/b) + f(n) –Using induction to prove the explicit formula for T(n)

Running time and big-Oh Running time: –Counting primitive operations –Dealing with loops (e.g. midterm Q1)  n i=1 i = n (n+1)/2 is O(n 2 ) –Worst-case vs average-case vs best-case Big-Oh notation: –Mathematical definition –Proving big-Oh relationships From the definition Using simplification rules Using limit of ratio Big-Oh hierarchy –Big-Oh is relevant only for large inputs. For small inputs, big-Oh may be irrelevant (remember integer multiplications) Big-Theta, Big-Omega Unless mentioned otherwise, big-Oh running time is for worst-case. Master-theorem for recurrences You need to know and understand the big- Oh running time of all algorithms seen in class and in homeworks.

Data structures Array: –running time for insert, delete, find... Single-linked list –Better than arrays: Easier to insert and delete No need to know size in advance –Worse than arrays: finding the n-th element is slow (so binarySearch is hard) Require more memory (for the "next" member) Doubly-linked list –Allow to move backward –Makes deleting elements easier Stacks and queues –You should understand all applications we saw

ADT (Abstract Data Structure) What it is: –Description of the interface of a data structure: Specifies what type of data can be stored What kind of operations can be performed Hides the details of implementation –Why it is important: Simplifies the way we think of large programs