The mod-and-div algorithm is slow—this algorithm computes an integer d such that nd ≤ m <>
The code for mod-and-div-faster as written uses division, by averaging lo and hi. Modify the algorithm so that it uses only addition, subtraction, multiplication, and comparison
Figure 7.6: A reminder of the algorithm to compute n mod k and ⌊n/k⌋, and a faster version.
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here