ch10-searching

ch10-searching - 2001-2009 M. D. Evans All Rights Reserved...

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

View Full Document Right Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 2001-2009 M. D. Evans All Rights Reserved 1 Ch 10. Search Techniques: 10.1 Introduction: Idea: look-up a key in a table, report position and success. Where: table - linear impl n (arrays, lists linked, hash) - non-linear impl n (trees) table component = data record 2001-2009 M. D. Evans All Rights Reserved 2 Search techniques chosen according to considerations: 1. Space vs. time i.e. fast method but wastes space or slow method which economizes space. 2. Static vs. dynamic tables questions of space vs. time. 3. Table size Can table fit in memory or must it be partitioned. Some techniques generally poor but okay for small tables. Cost of searching = # of comparisons needed to find key. 2001-2009 M. D. Evans All Rights Reserved 3 10.2 Possible Searching Techniques: 1. Sequential Approaches: - unordered array - avg = - worst = generally - ordered array - avg = worst = - unordered linked list - as above, but more space - ordered linked list - as above. In general: - Methods all O(n) - Ordered structures faster when key not in structure, but must spend more time producing / maintaining the order. - Only good for short tables. 2001-2009 M. D. Evans All Rights Reserved 4 Time-accumulated costs of searching: Consider daily searching of unordered sequential list. Consider daily searching of unordered sequential list....
View Full Document

Page1 / 12

ch10-searching - 2001-2009 M. D. Evans All Rights Reserved...

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