Assignment 6 - Euclid's Algorithm

  1. General Outline
    Although historically Euclid's Algorithm was implemented by substracting the smaller number from the larger one, the famous version of the algorithm has one improvement: it computes the remainder of the division of two numbers instead of their difference. The task is to update the below program accordingly and to do some further changes of the input-output behaviour.

  2. Test the original program.
    Test the currently implement algorithm with inputs 1000 and 2. Scroll down the window to inspect the output.

  3. The Changes in Detail
    Read the program and understand what is going on. Then do the following changes.

  4. Test your program.
    Run the whole program and test it. Compare it on the inputs 1000 and 2 with the old program. Scroll down to check the protocol output printed during the computation. Is it faster than the old one?

    You can hand in the program after checking its correctness by showing it to the lecturer.
Java Script Program starts here.



Java Script program ends here.