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 · 129 阅读 · 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 · 181 阅读 · 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 · 179 阅读 · 0 评论
分享