摘要: 2024年7月12日 题232. 用栈实现队列 两边倒即可,要出队列就倒到右边去,然后再回来。 class MyQueue { Stack<Integer> s1; Stack<Integer> s2; int size; public MyQueue() { s1 = new Stack<>(); 阅读全文
posted @ 2024-07-12 15:09 hailicy 阅读(2) 评论(0) 推荐(0) 编辑
摘要: 2024年7月12日 易错: split(" ")要小心字符串有多个空格连在一起,这样会得到一些空字符串""在数组中 暂时都用substring()快速解决。 KMP暂时放一下,后面复习, 字符串右旋转: import java.util.*; public class Main{ public s 阅读全文
posted @ 2024-07-12 12:11 hailicy 阅读(2) 评论(0) 推荐(0) 编辑