Re: Counting...


[ Follow Ups ] [ Post Followup ] [ CS2604 Discussion WWWBoard ] [ FAQ ]

Posted by Sleepless Snowman on August 01, 1999 at 17:59:46:

In Reply to: Re: Counting... posted by MtBiker on August 01, 1999 at 17:50:54:

no didn't do a while loop...

instead of having both conditions in the second loop be for j greater 0 and array[j] less than array[j-1], the condition is changed to only j greater than 0. I replaced the array checking into an if else statement. regardless of wethere or not it's greater than or less than, it is still performing the check. if it's true, then it actually calls the swap function. if the test fails, well, you still have to increment the comparison counter because you just made a compare and it was false.

am i on the wrong line of thinking here?


Follow Ups:



Post a Followup

Name:
E-Mail:

Subject:

Comments:

Optional Link URL:
Link Title:
Optional Image URL:


[ Follow Ups ] [ Post Followup ] [ CS2604 Discussion WWWBoard ] [ FAQ ]