Read carefully the following program:
- import java.util.Scanner;
- public class root
- {
- public static void main(String[] args)
- {
- Scanner input = new Scanner(System.in);
- double number = input.nextDouble();
- double a = 2;
- while (Math.abs(a-(number/a))>=0.25) {
- a = (a+(number/a))/2;
- }
- a = Math.floor(a);
- number = a;
- a = 2;
- while (Math.abs(a-(number/a))>=0.25) {
- a = (a+(number/a))/2;
- }
- a = Math.floor(a);
- System.out.println((int) a);
- }
- }
In Big O notation, what is the run-time of this algorithm as a function of the input n?