Loading

摘要: https://leetcode-cn.com/problems/shu-zu-zhong-chu-xian-ci-shu-chao-guo-yi-ban-de-shu-zi-lcof/ 使用摩尔投票,使用两个变量。遍历数组 第一个记录当前遍历的数组的值,第二个记录当前遍历数字出现的次数 如果下一个 阅读全文
posted @ 2022-02-11 11:48 Zhbeii 阅读(28) 评论(0) 推荐(0)
摘要: class Solution { public boolean verifySequenceOfBST(int [] sequence) { Stack<Integer> stack = new Stack<>(); int root = Integer.MAX_VALUE; for(int i = 阅读全文
posted @ 2022-02-11 11:22 Zhbeii 阅读(30) 评论(0) 推荐(0)