08 2022 档案

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