DOC PREVIEW
ASU CSE 310 - L01

This preview shows page 1-2-3-4-5 out of 16 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 16 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 16 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 16 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 16 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 16 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 16 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

CSE310 Lecture01: Algorithms, Counting and Data StructuresTopics of this lectureAlgorithmsExample of what is an algorithmExample of what is not an algorithmAnother view of algorithmsTime complexity of an algorithmSpace complexity of an algorithmComplexity of an algorithmCounting techniques and induction proofGrowth of functionsData structuresUsing the right data structuresUsing the right algorithmSummaryReadings and [email protected] Lecture01:CSE310 Lecture01:Algorithms, Counting and Data StructuresAlgorithms, Counting and Data StructuresGuoliang (Larry) XueDepartment of CSEArizona State Universityhttp://optimization.asu.edu/[email protected] of this lectureTopics of this lectureDiscussion of SyllabusAlgorithmsdefinitiontime complexityspace complexityCounting and Induction Proofnumber of operationsspace requirementData Structuresstacks and queuesadvanced data [email protected]An algorithm is a well-defined step by step computational procedure thatis deterministictakes some inputproduces some outputstops on any inputExamples illustrating what is an algorithm and what is not an [email protected] of what is an algorithmExample of what is an algorithmGiven a sequence of n numbers, compute the sum. Can we design an algorithm for this?Given a sequence of n numbers, order them in non-decreasing order, Can we design an algorithms for this?Introduce insertion [email protected] of what is Example of what is notnot an algorithm an algorithmThe 3n+1 problem.Given an integer n, if n=1 output n and stop; if n is even, output n=n/2 and continue; if n is odd, output n=3n+1 and continue;Is the above an algorithm?Print out all positive integers.Print our the first 10000000 positive [email protected] view of algorithmsAnother view of algorithmsAn algorithm is a tool to solve a well-defined computational problem.An instance of a problem.Example of a problem: Given a sequence of numbers, order them into non-decreasing order.An instance of the above problem is given by the input sequence 5, 4, 3, 2, 1.Another instance of the above problem is given by the input sequence 7, 5, 1, [email protected] complexity of an algorithmTime complexity of an algorithmGiven an algorithm A for solving a particular problem, what is the time complexity of the algorithm?Time complexity is measured using the number of operations required.We also need to note the input size of the problem instance.Examples: (1) summation, (2) matrix [email protected] complexity of an algorithmSpace complexity of an algorithmGiven an algorithm A for solving a particular problem, what is the space complexity of the algorithm?Space complexity is measured using the number of memory cells required.We also need to note the input size of the problem instance.Examples: (1) summation, (2) matrix [email protected] of an algorithmComplexity of an algorithmBest case analysisAverage case analysisWorst case analysisAmortized [email protected] techniques and induction proofCounting techniques and induction proof1+2+3+4+...+n=?1+1/2+1/3+1/4+...+1/n=?1+1/2+1/4+1/8+...+(1/2)n=?[email protected] of functionsGrowth of functionslg (n)sqrt(n)nn log(n)n2n32n[email protected] structuresData structuresWhat is an Abstract Data Type?A collection of data elementsA collection of functions on the data elementsWhy data structures?to store data efficientlyto process data efficientlyExamples of data structures:stacks and queuesbinary search [email protected] the right data structuresUsing the right data structuresHow to represent a polynomial of order n?use an array of size nuse a linked listHow to perform addition, subtraction and multiplication using the array representation?How to perform addition, subtraction and multiplication using the linked list representation?Which data structure is [email protected] the right algorithmUsing the right algorithmIf the first 6 terms in a sequence are 1, 1, 2, 3, 5, 8, what is the 7th term? What is the nth term?This sequence is called the Fibonacci sequence.Let us write two algorithms for computing the nth Fibonacci number.Which algorithm is [email protected]What is an algorithm?What is an ADT?Counting.Proof using mathematical induction.Problems and instances.Comparison of [email protected] and ExercisesReadings and ExercisesMost materials covered in this lecture can be found in Section 1.1, Section 1.2, Section 2.1 and 2.2.You should work on Exercises 1.1.1-1.1.5 (p.10) and Problems 1.1 (p.13).There may be a pop up quiz on the above topics.Lecture 02 will be on asymptotic notations. To preview, read Sections 3.1 and


View Full Document

ASU CSE 310 - L01

Documents in this Course
Load more
Download L01
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view L01 and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view L01 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?