Data Structure & Algorithm: Level-1 Problem #21. Square Root

Given an unsigned integer, try to calculate its square root value without using the math.sqrt() function.

Sample Input: 10

Sample Output: 3.162277660168379

The square root value for 10 is 3.162277660168379.


数据结构和算法:初级练习题 #21 – 平方根


给定一个整数,不使用数学函数 math.sqrt() 来计算它的平方根。

输入样例: 10

输出样例: 3.162277660168379

数字10的平方根是 3.162277660168379。

Python Solution

Square Root