![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
algorithm
weixin_38783585
这个作者很懒,什么都没留下…
展开
-
二叉树中和为某一值的路径
import java.util.ArrayList;import java.util.Stack;import java.util.Collections;/**public class TreeNode { int val = 0; TreeNode left = null; TreeNode right = null; public TreeNode(int val)...原创 2018-04-20 22:18:14 · 90 阅读 · 0 评论 -
367. Valid Perfect Square
method1 simple but not allow public boolean isPerfectSquare(int num) { int sqrt = (int) Math.sqrt(num); return sqrt * sqrt == num; } method2 newto method public boolean isP...原创 2019-07-11 10:32:28 · 132 阅读 · 0 评论 -
374. Guess Number Higher or Lower
this is a binary search problem. code show as below: public class Solution extends GuessGame { public int guessNumber(int n) { int left = 1, right = n; while (left < right) { ...原创 2019-07-11 10:58:24 · 121 阅读 · 0 评论