Given a positive integer num, write a function which returns True if num is a perfect square else False.
Note: Do not use any built-in library function such as sqrt
.
Example 1:
Example 2:
Credits:
Special thanks to @elmirap for adding this problem and creating all test cases.
Subscribe to see which companies asked this question
思路:
2分查找。
java code:
上一篇 Hibernate技术文档