<jupyter_start><jupyter_text>说明：    设计循环队列的实现。循环队列是一种线性数据结构，其中的操作是基于FIFO（先进先出）原理执行的，    最后一个位置又连接回第一个位置以构成一个圆。也称为“环形缓冲区”。    循环队列的好处之一是我们可以利用队列前面的空间。    在普通队列中，一旦队列已满，即使队列前面有空格，我们也无法插入下一个元素。    但是使用循环队列，我们可以使用空间来存储新值。您的实现应支持以下操作：要求；    1、MyCircularQueue(k): Constructor, set the size of the queue to be k.    2、Front: Get the front item from the queue. If the queue is empty, return -1.    3、Rear: Get the last item from the queue. If the queue is empty, return -1.    4、enQueue(value): Insert an element into the circular queue. Return true if the operation is successful.    5、deQueue(): Delete an element from the circular queue. Return true if the operation is successful.    6、isEmpty(): Checks whether the circular queue is empty or not.    7、isFull(): Checks whether the circular queue is full or not.<jupyter_code>class MyCircularQueue:

    def __init__(self, k: int):
        """
        Initialize your data structure here. Set the size of the queue to be k.
        """
        self.k = k
        self.queue = []
        

    def enQueue(self, value: int) -> bool:
        """
        Insert an element into the circular queue. Return true if the operation is successful.
        """
        if not self.isFull():
            self.queue.append(value)
            return True
        return False
        

    def deQueue(self) -> bool:
        """
        Delete an element from the circular queue. Return true if the operation is successful.
        """
        if not self.isEmpty():
            self.queue.pop(0)
            return True
        return False
        

    def Front(self) -> int:
        """
        Get the front item from the queue.
        """
        if not self.isEmpty():
            return self.queue[0]
        return -1
        

    def Rear(self) -> int:
        """
        Get the last item from the queue.
        """
        if not self.isEmpty():
            return self.queue[-1]
        return -1

    def isEmpty(self) -> bool:
        """
        Checks whether the circular queue is empty or not.
        """
        if len(self.queue) == 0:
            return True
        return False
        

    def isFull(self) -> bool:
        """
        Checks whether the circular queue is full or not.
        """
        if len(self.queue) == self.k:
            return True
        return False
        


# Your MyCircularQueue object will be instantiated and called as such:
# obj = MyCircularQueue(k)
# param_1 = obj.enQueue(value)
# param_2 = obj.deQueue()
# param_3 = obj.Front()
# param_4 = obj.Rear()
# param_5 = obj.isEmpty()
# param_6 = obj.isFull()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.09359605911330049, 'fraction_numerical': 0.007957559681697613, 'mean_word_length': 2.05909617612978, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '517701', 'license': 'Apache-2.0', 'n_tokens_mistral': 866, 'n_tokens_neox': 887, 'n_words': 267, 'path': 'Queue/622. Design Circular Queue.ipynb', 'repo_name': 'YuHe0108/Leetcode', 'size': '2639'}