08 2022 档案
摘要:leetcode 1656. 设计有序流 该题实现了一种简单的数据结构,可以允许数据以不同的顺序写入,但是以给定的顺序读取,并且每次写入后都可以以给定顺序返回下一批有序数据。 class OrderedStream: def __init__(self, n: int): self.ptr = 1
阅读全文
摘要:设计循环双端队列 class MyCircularDeque { private int[] elements; private int rear, front; private int capacity; public MyCircularDeque(int k) { capacity = k +
阅读全文
摘要:leetcode 622. 设计循环队列 class MyCircularQueue { private int[] queue; private int head; private int tail; private boolean isEmpty; public MyCircularQueue(
阅读全文

浙公网安备 33010602011771号