[CSI] Question Correctness for Lab 003

Weilong Ren wren3 at kent.edu
Thu Oct 1 16:13:02 EDT 2020


This email is for you in *Lab Section 003*.

For the question of minisort with functions (Lab 6), "can we put the code
for swapping in the definition of the swap function, instead of main
function", I may misunderstand it. *If you mean the codes as follows, the
answer is no*. You need to revoke swap in the main function.

input three numbers
      if first number is greater than second
          invoke the swap function to swap first and second numbers
      if first is greater than third
          invoke the swap function to swap first and third numbers
      if second is greater than third
          invoke the swap function to swap second and third numbers
      output three sorted numbers


Best Regards,

Weilong
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://listmail.cs.kent.edu/pipermail/cs13001/attachments/20201001/d801a722/attachment.html 


More information about the cs13001 mailing list