Assignment 6 - Euclid's Algorithm

  1. Getting Started

    Please refer to this page for information on how to work on your assignment.

  2. Task of this exercise

    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.

  3. Test the original program

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

  4. The Changes in Detail

    Read the program and understand what is going on. Then do the following changes:

  5. 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.

JavaScript Starts Here.
JavaScript Ends Here.