Lecture03 - Draw a picture of something from Seattle CSE...

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

View Full Document Right Arrow Icon
1 CSE 421 Algorithms Richard Anderson Lecture 3 Draw a picture of something from Seattle 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 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 What does it mean for an algorithm to be efficient? Definitions of efficiency • Fast in practice • Qualitatively better worst case performance than a brute force algorithm
Background image of page 1

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

View Full DocumentRight Arrow Icon
2 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
Background image of page 2
Image of page 3
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 / 4

Lecture03 - Draw a picture of something from Seattle CSE...

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

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