Implement square root function using basic operations ?
Anonymous
The first solution is using binary search from 0 to a that is if a > 1, and if a < 1 then search in the interval 0 to 1 and the second solution is to use Newton Raphson's Method with the iterative formula x[n] = x[n-1] - ((x[n-1]*x[n-1]-a)/(2*x[n-1])) and the initial guess x[0] = a/2 and it will converge faster than the binary search
Check out your Company Bowl for anonymous work chats.