Saturday, October 24, 2009 6:51 PM,




I was not going to forward this one to the class, since I thought you all knew 
how to do this.  However, two of my TAs told me that they have had to answer 
this question several times in the last few days, so I am forwarding it.  If 
you know how to determine if A is greater than B, then delete and move on.

A student writes:



	 Dr. Patt, I had a quick question about the sort. I understand how the 
	 selection sort works, and I have a good idea of how to implement it in 
	 my program, but how do we test each number if we don't have a greater 
	 than option?
	
	 Thanks
	 <<name withheld to protect the student seeking a "greater than" 
	 option>>



Yes, you do have a "greater than" option.

Suppose you want to know whether A is greater than B.  Do you know how to form 
A-B?  If you added (with an ADD instruction) A and -B, is there any way to 
tell from the answer whether A is greater than B?

Good luck finishing the assignment.

Yale Patt