根据逆波兰表达式,求该后缀表达式的计算结果。 有效的算符包括 +、-、*、/ 。每个运算对象可以是整数,也可以是另一个逆波兰表达式。 依靠示例读懂题 示例 1:输入:tokens = ["2","1","+","3","*"]输出:9解释:该算式转化为常见的中缀算术表达式为:((2 + 1) * 3 Read More
posted @ 2021-08-27 09:48 K峰 Views(283) Comments(0) Diggs(0)
ExecutorService是Java提供的用于管理线程池的类。该类的两个作用:控制线程数量和重用线程 常用的线程池实现 Executors.newCacheThreadPool()创建一个普通的池子,当使用时首先会查看池子中是否有空闲线程,若没有则新建 Executors.newFixedThr Read More
posted @ 2021-08-26 16:11 K峰 Views(83) Comments(1) Diggs(0)
微服务架构 微服务架构就是将单体的应用程序分成多个应用程序,这多个应用程序就是微服务,而且各个服务可以使用不同的编程语言、不同的数据库可以极大的降低耦合性。 SpringCloud使用得意义 利用SpringBoot开发的便利性,简化了分布式系统基础设施的开发,服务发现、配置中心、负载均衡、断路器、 Read More
posted @ 2021-08-26 15:57 K峰 Views(47) Comments(0) Diggs(0)
有序升序环链表,找到最小头 Node newhead = null; Node slow = head; Node fast = head.next; while(fast.val >= slow.val){ slow = slow.next; fast = fast.next; if(fast = Read More
posted @ 2021-08-26 15:10 K峰 Views(85) Comments(0) Diggs(0)
一歪脑袋是二叉树,哈哈,其实我没发现,但是也是用递归,并不优雅的递归,后来受大佬的启发 /* // Definition for a Node. class Node { public int val; public Node prev; public Node next; public Node Read More
posted @ 2021-08-26 14:18 K峰 Views(127) Comments(0) Diggs(0)
偶数找偏左,奇数找中点 ListNode slow = head; ListNode fast = head.next; while(fast != null && fast.next != null){ slow = slow.next; fast = fast.next.next; } 偶数找偏 Read More
posted @ 2021-08-26 09:20 K峰 Views(68) Comments(0) Diggs(0)
我告诉自己,自己写的这个一定要记录下来,,,不为别的,只是因为我太憨了。这个题我一开始的想法,是根据这一条链表,反转新建一条新链表,然后两个开始遍历,结果后来发现,在反转的时候head这个链表就已经发生改变了,虽然我ListNode op = head,但是这个op还是在操作head。并没有重新建一 Read More
posted @ 2021-08-25 18:39 K峰 Views(60) Comments(0) Diggs(0)
/** * Definition for singly-linked list. * public class ListNode { * int val; * ListNode next; * ListNode() {} * ListNode(int val) { this.val = val; } Read More
posted @ 2021-08-25 16:07 K峰 Views(81) Comments(0) Diggs(0)
/** * Definition for singly-linked list. * public class ListNode { * int val; * ListNode next; * ListNode() {} * ListNode(int val) { this.val = val; } Read More
posted @ 2021-08-25 11:27 K峰 Views(28) Comments(0) Diggs(0)
/** * Definition for singly-linked list. * public class ListNode { * int val; * ListNode next; * ListNode(int x) { * val = x; * next = null; * } * } * Read More
posted @ 2021-08-25 11:11 K峰 Views(34) Comments(0) Diggs(0)