Experimentation with Karatsuba algorithm
1. Experiment code for Karatsuba and Long Multiplication (Karatsuba.java)
Here are the details of the activity:
1. Implement long multiplication and Karatsuba algorithm and test your implementation.
2. For the remaining exercises, use the code provided.
3. Note that the Karatsuba algorithm is better than the long
multiplication algorithm as per the asymptotic analysis that we did
in class.
4. Run the given code that has the implementation of both the
algorithms. Check which algorithm runs faster for small size
numbers.
5. What did you observe?
6. Can you explain your observation?
7. Now change the constant BASE_CASE to 100 and redo the comparative
analysis.
8. Again, change the constant BASE_CASE to 2000 and redo the
comparative analysis.
9. What did you observe?
10. Can you explain your observation?