{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

cps6-111122Handout

cps6-111122Handout - • Time the algorithms – Import...

This preview shows pages 1–2. Sign up to view the full content.

CompSci 6 Introduction to Computer Science November 22, 2011 Prof. Rodger Announcements Read for next time Chap. 11.1-2 Reading Quiz on Blackboard soon – Due before class next time Assignment 6 due Tues, Nov 29 Problem – Find the two smallest numbers Problem in Chapter 10 – search.py Three different algorithms/approaches to finding the two smallest in a list – Find, Remove, Find – Sort, Identify minimums, get indices – Walk through list keeping track of two smallest so far Think about how long each step takes Compares them by timings To solve the problem Understand the algorithms – are they correct? Prepare data – randomInts.py

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: • Time the algorithms – Import time – Start = time.time() – End = time.time() – totalTime = end - start What is Computer Science? • The Organization of Data, and Searching CompSci 6 Fall 2011 5 Now let’s focus on searching • Linear Search – linear_search1 – linear_search2 – linear_search3 • Compare and time three methods • Binary search – algorithm – Tradeoff – data must be sorted to use Binary Search 3 7 8 10 13 18 21 22 25 34 37 42 44 46 49 Welcome Victoria Interrante • Associate Professor • University of Minnesota • Ph.D. UNC-Chapel Hill, 1996 • Research in Graphics and Visualization...
View Full Document

{[ snackBarMessage ]}

Page1 / 2

cps6-111122Handout - • Time the algorithms – Import...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online