Given a number x and an integer n, design an algorithm to compute the n-th root of x.
Solution:
There is one n-th root algorithm that is based on Newton’s method. Using Halley’s method can achieve cubic convergence.
Reference: Stackoverflow
Given a number x and an integer n, design an algorithm to compute the n-th root of x.
Solution:
There is one n-th root algorithm that is based on Newton’s method. Using Halley’s method can achieve cubic convergence.
Reference: Stackoverflow