project1 notes - 5. count all the comparisons necessary in...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Notes on project 1 1. counting comparisons: don't count test when skipping remainder of input line 2. count shuffleStack operations from main and inside ShuffleStack, count the moveOver operations 3. don't count the comparison of input value to -1 4. count shuffleStack.push once in the main. don't count calls to a helper function like 'pushItem', since that only does the assignment and top pointer change.
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 5. count all the comparisons necessary in shuffleStack methods (like pop, push, peek) 6. no need for isEmpty since stack operations can check for top==0. so no need to count comparisons for isEmpty if defined. 7. count all comparisons up to and including successful sort. also count comparisons necessary to determine that sort cannot be done....
View Full Document

This note was uploaded on 05/04/2008 for the course CS 352 taught by Professor Mullins during the Winter '07 term at University of Missouri-Kansas City .

Ask a homework question - tutors are online