摘要: 1、用队列模拟栈 python 1 class MyStack: 2 3 def __init__(self): 4 """ 5 Initialize your data structure here. 6 """ 7 self.queue1 = collections.deque() 8 self 阅读全文
posted @ 2021-12-28 23:33 r1-12king 阅读(56) 评论(0) 推荐(0)
摘要: 1、链表反转 模板: 1.1 反转链表 1 class Solution { 2 public ListNode reverseList(ListNode head) { 3 ListNode prev = null; 4 ListNode curr = head; 5 while (curr != 阅读全文
posted @ 2021-12-28 22:18 r1-12king 阅读(42) 评论(0) 推荐(0)