Map Hash Tables and Dictionaries_Part_11

Map Hash Tables and Dictionaries_Part_11 - Running Time...

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

View Full Document Right Arrow Icon
Last Updated: 06/02/12 10:23 PM CSE 2011 Prof. J. Elder - 51 - Running Time Binary search can interact poorly with the memory hierarchy (i.e. caching ), because of its random-access nature. It is common to abandon binary searching for linear searching as soon as the size of the remaining span falls below a small value such as 8 or 16 or even more in recent computers.
Background image of page 1

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

View Full DocumentRight Arrow Icon
Last Updated: 06/02/12 10:23 PM CSE 2011 Prof. J. Elder - 52 - <precondition>: A[1. .n] is sorted in non-decreasing order <postcondition>: If is in A[1. .n], algorithm returns 1, its location loop-invariant>: If is BinarySea in rch(A[1. .n], whil ) e pq key qp e n ky < > == if [ ] els 2 1 return( ) return("Key n A[1. .n], then e end end if [ ] end is in A[p. . ot in list") q] mid q p mi A m id A p d lse + ⎢⎥ = ⎣⎦ = =+ =
Background image of page 2
Last Updated: 06/02/12 10:23 PM
Background image of page 3

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

View Full DocumentRight Arrow Icon
Background image of page 4
Background image of page 5
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 02/14/2012 for the course CSE 2011Z taught by Professor Elder during the Fall '11 term at York University.

Page1 / 5

Map Hash Tables and Dictionaries_Part_11 - Running Time...

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