Pregunta de entrevista de Meta

Implement square root function using basic operations ?

Respuestas de entrevistas

Anónimo

2 ene 2011

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

2

Anónimo

3 nov 2010

It is a binary search between 0 and given number. I got it that right but I messed up binary search implementation part.

1

Anónimo

17 abr 2013

http://www.woolor.com/InterviewMitra/97/use-basic-operations-to-create-a-square-root-function