上一页 1 2 3 4 5 6 7 8 ··· 11 下一页
摘要: ##041. 滑动窗口的平均值 Queue queue = new LinkedList(); 循环队列实现 class MovingAverage { int hh=0,tt=0; double sum=0; int []q; /** Initialize your data structure 阅读全文
posted @ 2022-03-06 23:07 liv_vil 阅读(33) 评论(0) 推荐(0)
摘要: ##036. 后缀表达式 class Solution { Stack<Integer>nums=new Stack<Integer>(); public int evalRPN(String[] tokens) { for(String x: tokens) { char k=x.charAt(0 阅读全文
posted @ 2022-03-04 22:09 liv_vil 阅读(24) 评论(0) 推荐(0)
摘要: ##030. 插入、删除和随机访问都是 O(1) 的容器 hash存数组下标 删除时 思路清奇地使用swap交换要删除的值x与nums数组尾巴y 使得能O(1)pop_back unordered_map<int,int>m; vector<int>nums; /** Initialize your 阅读全文
posted @ 2022-03-03 22:39 liv_vil 阅读(30) 评论(0) 推荐(0)
摘要: ListNode“变量”是引用 是指向该对象的遥控器 不真的是该对象 ##021. 删除链表的倒数第 n 个结点 class Solution { public ListNode removeNthFromEnd(ListNode head, int n) { int m=0; ListNode d 阅读全文
posted @ 2022-02-28 15:06 liv_vil 阅读(30) 评论(0) 推荐(0)
摘要: ##014. 字符串中的变位词 class Solution { Map<Character,Integer> m1 =new HashMap<>(); Map<Character,Integer> m2 =new HashMap<>(); public boolean check(char c) 阅读全文
posted @ 2022-02-26 10:14 liv_vil 阅读(39) 评论(0) 推荐(0)
摘要: int是java提供的8种原始数据类型之一,Java为每个原始类型提供了封装类,Integer是java为int提供的封装类。 Integer用equals ##007. 数组中和为 0 的三个数 class Solution { public List<List<Integer>> threeSu 阅读全文
posted @ 2022-02-23 11:54 liv_vil 阅读(48) 评论(0) 推荐(0)
摘要: ##001. 整数除法 位运算 学到的小知识: 两数符号判断可以用(a>0)(b>0) java语法 Integer.MIN_VALUE equals比较堆的内容 ==比较的栈的内容(String、基本数据) 没注意的细节: 当除数大于230时要break class Solution { publ 阅读全文
posted @ 2022-02-21 17:16 liv_vil 阅读(19) 评论(0) 推荐(0)
摘要: ##5922. 统计出现过一次的公共字符串 哈希 unordered_map<string,int>m1,m2; int countWords(vector<string>& words1, vector<string>& words2) { for(int i=0;i<words1.size(); 阅读全文
posted @ 2021-11-28 09:54 liv_vil 阅读(26) 评论(0) 推荐(0)
摘要: 开发微信产品涉及到注册邮箱的一定要谨慎了,如果注册错了,是注销不了的,而且这个邮箱是不能再用到其它产品的。 我本想注册小程序APPID,结果注册到开放平台,现在追悔莫及,只能换邮箱了。 微信公众平台(公众号/小程序的管理后台):https://mp.weixin.qq.com/ 微信开放平台(APP 阅读全文
posted @ 2021-11-09 17:14 liv_vil 阅读(1090) 评论(0) 推荐(1)
摘要: ![](https://img2020.cnblogs.com/blog/2241205/202111/2241205-20211109160819246-1884913329.png) 阅读全文
posted @ 2021-11-09 16:08 liv_vil 阅读(24) 评论(0) 推荐(0)
上一页 1 2 3 4 5 6 7 8 ··· 11 下一页