CS101.Lect30.Searching.ppt

CS101.Lect30.Searching.ppt - CS101 Lecture 30: Searching...

Info iconThis preview shows pages 1–5. Sign up to view the full content.

View Full Document Right Arrow Icon
Computer Science CS101 Lecture 30: Searching Algorithms Linear Search Binary Search Aaron Stevens (azs@bu.edu) 1 December 2011 Computer Science What You’ll Learn Today What is searching? Why does searching matter? How is searching accomplished? Why are there different searching algorithms? On what basis should we compare algorithms?
Background image of page 1

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

View Full DocumentRight Arrow Icon
Computer Science Searching Searching Attempting to find an item in a collection. It is always possible that the item might not be found. Search key The field (or fields) on which the search is based. Computer Science Example: Search Key Consider this list: http://www.patriots.com/team/
Background image of page 2
Computer Science Example: Search Key Now consider this list: Computer Science Example: Search Key NFL uniform numbers follow a specific scheme to make search by number easy for TV announcers… Numbers 1 to 19 are worn by quarterbacks, kickers, and punters. Numbers 20 to 49 are worn by running backs, tight ends, cornerbacks and safeties. Numbers 50 to 59 are worn by linebackers and offensive linemen. Numbers 60 to 79 are worn by members of both the offensive line and defensive line. Numbers 80 to 89 are worn by wide receivers and tight ends. Numbers 90 to 99 are worn by linebackers and defensive linemen.
Background image of page 3

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

View Full DocumentRight Arrow Icon
Computer Science Why Does Searching Matter? Given a large enough set of data, it could take a long time to find something! Example:
Background image of page 4
Image of page 5
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 14

CS101.Lect30.Searching.ppt - CS101 Lecture 30: Searching...

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

View Full Document Right Arrow Icon
Ask a homework question - tutors are online