I think another very efficient way of writing our program would be to do it the same way as we were in class but with the highest numbers. So instead of checking for the smallest and moving it to the front, look for the largest and move the largest number to the back. It would be just as efficient its just a different way of doing things. I tried thinking of a more efficient way to create the output but I couldn't think of one... Unless I knew what the range of numbers that were being selected for the program are.
No comments:
Post a Comment