Q1. Divide n1 by n2 without using division. Give time complexity Q2. Improve previous answer
Anonymous
Define a counter i = 0 and add one each time, find i such that n2*2^(i-1) < n1 <= n2*2^i . Now using binary search in the range (2^(i-1), 2^i) find n3 such that (n1 - n3*n2) is the minimum positive integer.
Check out your Company Bowl for anonymous work chats.