Question: WAP in Java to take user input N and M as a positive integer. Find the n-th root of N using a Binary Search Algorithm.
WAP in Java to take user input N and M as a positive integer. Find the n-th root of N using a Binary Search Algorithm.
If you are getting the n-th root of N in decimal then print the floor value of your result. Let's say N = 5 , M = 2 so, 5 to the power (1/2). floor (2.6457) = 2
N = 16 , M = 4, so 16 to the power (1/4). floor (2.0) = 2.
Step by Step Solution
There are 3 Steps involved in it
To solve this problem using Java well use the concept of binary search to find the nth root of a number with an integer floor value Steps to solve Ste... View full answer
Get step-by-step solutions from verified subject matter experts
