Tag: Deque

  • Algorithms 101: Deque Implementation Using Fixed Array

    Deque Implementation Using Fixed Array (双端队列用固定数组的实现) Implementing a deque using a fixed-size array is another efficient method that provides constant-time access to elements and operations at both ends of the deque. This approach, however, requires handling the circular nature of the deque when the array is full or when operations…

  • Algorithms 101: Deque Implementation Using Doubly Linked List

    Deque Implementation Using Doubly Linked List (双端队列用双链表的实现) A deque can be efficiently implemented using a doubly linked list. This approach allows constant-time insertions and deletions at both the front and rear of the deque. In a doubly linked list, each node contains three parts: the data, a pointer to the…