Sorting2.3 - Maintaining Loop Invariant • Consider...

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: Maintaining Loop Invariant • Consider element at location j – If greater than pivot, incorporate into ‘> set’ by incrementing j. – If less than or equal to pivot, incorporate into ‘ set’ by swapping with element at location i+1 and incrementing both i and j. – Measure of progress: size of unprocessed set. CSE 2011 Prof. J. Elder - 66 - Last Updated: 4/1/10 11:16 AM Maintaining Loop Invariant CSE 2011 Prof. J. Elder - 67 - Last Updated: 4/1/10 11:16 AM Establishing Loop Invariant CSE 2011 Prof. J. Elder - 68 - Last Updated: 4/1/10 11:16 AM Establishing Postcondition Exhaustive on exit CSE 2011 Prof. J. Elder - 69 - Last Updated: 4/1/10 11:16 AM Establishing Postcondition CSE 2011 Prof. J. Elder - 70 - Last Updated: 4/1/10 11:16 AM ...
View Full 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

Sorting2.3 - Maintaining Loop Invariant • Consider...

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