Lecture03 - CSE 421 Algorithms Richard Anderson Lecture 3...

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

View Full Document Right Arrow Icon
CSE 421 Algorithms Richard Anderson Lecture 3
Background image of page 1

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

View Full DocumentRight Arrow Icon
Draw a picture of something from Seattle
Background image of page 2
What is the run time of the Stable Matching Algorithm? Initially all m in M and w in W are free While there is a free m w highest on m’s list that m has not proposed to if w is free, then match (m, w) else suppose (m 2 , w) is matched if w prefers m to m 2 unmatch (m 2 , w) match (m, w) Executed at most n 2 times
Background image of page 3

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

View Full DocumentRight Arrow Icon
O(1) time per iteration Find free m Find next available w • If w is matched, determine m 2 Test if w prefer m to m 2 Update matching
Background image of page 4
What does it mean for an algorithm to be efficient?
Background image of page 5

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

View Full DocumentRight Arrow Icon
Definitions of efficiency Fast in practice Qualitatively better worst case performance than a brute force algorithm
Background image of page 6
Polynomial time efficiency An algorithm is efficient if it has a polynomial run time Run time as a function of problem size Run time: count number of instructions executed on an underlying model of computation T(n): maximum run time for all problems of size at most n
Background image of page 7

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

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

This note was uploaded on 02/25/2012 for the course CSE 421 taught by Professor Richardanderson during the Fall '06 term at University of Washington.

Page1 / 19

Lecture03 - CSE 421 Algorithms Richard Anderson Lecture 3...

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

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