|
| 1 | +<h1 align='center'>CIRCULAR - DEQUE - DATA STRUCTURE - PROBLEMS</h1> |
| 2 | + |
| 3 | +<p align='center'>A <b>Circular Deque</b> is an advanced version of the double-ended queue (Deque) that behaves like a circular buffer. Unlike a linear deque, which allows insertion and deletion of elements from both ends (front and rear), the circular deque links the last position to the first position, creating a loop. This allows for more efficient use of space and ensures that the queue can be used in continuous cycles without the risk of unused memory.</p> |
| 4 | + |
| 5 | +In a circular deque, when either the front or the rear pointer reaches the ends of the queue, it automatically wraps around to the beginning if there is available space. This property is particularly useful in applications where continuous and efficient data processing is needed, such as in task scheduling, resource management, and buffering data streams. |
| 6 | + |
| 7 | +Key operations in a circular deque include: |
| 8 | +- **Insert Front**: Adds an element at the front of the deque. |
| 9 | +- **Insert Rear**: Adds an element at the rear of the deque. |
| 10 | +- **Delete Front**: Removes an element from the front. |
| 11 | +- **Delete Rear**: Removes an element from the rear. |
| 12 | +- **Get Front**: Returns the front element without removing it. |
| 13 | +- **Get Rear**: Returns the rear element without removing it. |
| 14 | +- **IsEmpty**: Checks if the deque is empty. |
| 15 | +- **IsFull**: Checks if the deque is full. |
| 16 | + |
| 17 | +Circular deques are widely used in scenarios such as: |
| 18 | +- Buffering and streaming data |
| 19 | +- Task scheduling with fixed time slots |
| 20 | +- Implementing efficient queues in operating systems |
| 21 | + |
| 22 | +### Repository Content |
| 23 | + |
| 24 | +<p> |
| 25 | +<img src="https://img.shields.io/badge/problems%20count-01-orange?logo=leetcode" alt="LeetCode"> |
| 26 | +<img src="https://img.shields.io/badge/problems%20count-00-darkgreen?logo=geeksforGeeks" alt="GeeksforGeeks"> |
| 27 | +<img src="https://img.shields.io/badge/total%20problems%20count-03-blue" alt="Problem Count"> |
| 28 | +</p> |
| 29 | + |
| 30 | +| No | Problem Name | Description | LeetCode | GFG | |
| 31 | +| --- | ------------ | ----------- | -------- | ----- | |
| 32 | +| 01 | [Example](https://github.com/JawadSher/DSA-LeetCode-GFG-Problems-Repository/tree/main/16%20-%20Queue%20Data%20Structure%20Problems/03%20-%20(Deque)%20Doubly%20Ended%20Queue%20Problems/01%20-%20Example) | Implement a circular deque using arrays with basic operations. | Non | Non | |
| 33 | +| 02 | [Design Circular Deque](https://github.com/JawadSher/DSA-LeetCode-GFG-Problems-Repository/tree/main/16%20-%20Queue%20Data%20Structure%20Problems/03%20-%20(Deque)%20Doubly%20Ended%20Queue%20Problems/01%20-%20Example) | Design a circular deque supporting insertions and deletions from both ends. | [Link](https://leetcode.com/problems/design-circular-deque/description/) | Non | |
| 34 | + |
| 35 | +--- |
| 36 | +Happy Coding 😊 |
0 commit comments