Skip to content

Commit e0e54af

Browse files
authored
Create README.md
1 parent 4494a54 commit e0e54af

File tree

1 file changed

+44
-0
lines changed
  • 16 - Queue Data Structure Problems/01 - Linear Queue Problems

1 file changed

+44
-0
lines changed
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<h1 align='center'>LINEAR - QUEUE - PROBLEMS</h1>
2+
3+
<p align='center'>A <b>Linear Queue</b> is a fundamental data structure in computer science used to store and manage a collection of elements in a specific order. It operates on a **First In, First Out (FIFO)** principle, meaning the first element added to the queue is the first one to be removed.
4+
</p>
5+
6+
A linear queue is typically used in scenarios like:
7+
- **Scheduling** tasks (e.g., in CPU scheduling).
8+
- **Handling requests** in a server.
9+
- **Buffer management** in data streams.
10+
11+
#### Operations:
12+
- **Enqueue**: Add an element to the rear of the queue.
13+
- **Dequeue**: Remove the element from the front of the queue.
14+
- **Peek**: View the element at the front without removing it.
15+
- **IsEmpty**: Check if the queue is empty.
16+
- **IsFull**: Check if the queue is full (when using a fixed-size array).
17+
18+
This simple yet powerful structure is widely used in many algorithms, providing an efficient way to manage data that follows the FIFO rule.
19+
20+
### Repository Content
21+
22+
<p>
23+
<img src="https://img.shields.io/badge/problems%20count-00-orange?logo=leetcode" alt="LeetCode">
24+
<img src="https://img.shields.io/badge/problems%20count-09-darkgreen?logo=geeksforGeeks" alt="GeeksforGeeks">
25+
<img src="https://img.shields.io/badge/total%20problems%20count-11-blue" alt="Problem Count">
26+
</p>
27+
28+
| No | Problem Name | Description | LeetCode | GFG |
29+
| --- | ------------------------------------------------------------------------- | ----------- | ------------- | -------- |
30+
| 01 | [Example](https://github.com/JawadSher/DSA-LeetCode-GFG-Problems-Repository/tree/main/16%20-%20Queue%20Data%20Structure%20Problems/01%20-%20Linear%20Queue%20Problems/01%20-%20Example) | Example problems demonstrating the basic usage of linear queue operations. | Non | Non |
31+
| 02 | [Linear Queue Implementation Using Arrays - NO STL](https://github.com/JawadSher/DSA-LeetCode-GFG-Problems-Repository/tree/main/16%20-%20Queue%20Data%20Structure%20Problems/01%20-%20Linear%20Queue%20Problems/02%20-%20Linear%20Queue%20Implementation%20Using%20Arrays%20-%20NO%20STL) | Implementation of a linear queue using arrays without the use of Standard Template Library (STL). | Non | Non |
32+
| 04 | [Implement Queue Using Array](https://github.com/JawadSher/DSA-LeetCode-GFG-Problems-Repository/tree/main/16%20-%20Queue%20Data%20Structure%20Problems/01%20-%20Linear%20Queue%20Problems/04%20-%20Implement%20Queue%20Using%20Array) | Problems related to implementing a queue data structure using an array. | Non| [Link](https://www.geeksforgeeks.org/problems/implement-queue-using-array/1?itm_source=geeksforgeeks&itm_medium=article&itm_campaign=practice_card) |
33+
| 05 | [Queue Reversal](https://github.com/JawadSher/DSA-LeetCode-GFG-Problems-Repository/tree/main/16%20-%20Queue%20Data%20Structure%20Problems/01%20-%20Linear%20Queue%20Problems/05%20-%20Queue%20Reversal) | Problem focused on reversing the elements in a queue using standard queue operations. | Non | [Link](https://www.geeksforgeeks.org/problems/queue-reversal/1) |
34+
| 06 | [First Negative Integer in Every Window of Size K](https://github.com/JawadSher/DSA-LeetCode-GFG-Problems-Repository/tree/main/16%20-%20Queue%20Data%20Structure%20Problems/01%20-%20Linear%20Queue%20Problems/06%20-%20First%20Negative%20Integer%20in%20Every%20Window%20of%20Size%20K) | Find the first negative integer in every sliding window of size K in a queue. | Non| [Link](https://practice.geeksforgeeks.org/problems/first-negative-integer-in-every-window-of-size-k/1) |
35+
| 07 | [Reverse First K Elements of Queue](https://github.com/JawadSher/DSA-LeetCode-GFG-Problems-Repository/tree/main/16%20-%20Queue%20Data%20Structure%20Problems/01%20-%20Linear%20Queue%20Problems/07%20-%20Reverse%20First%20K%20Elements%20of%20Queue) | Problem where the first K elements in the queue need to be reversed while maintaining the order of the remaining elements. | Non | [Link](https://www.geeksforgeeks.org/problems/reverse-first-k-elements-of-queue/1) |
36+
| 08 | [First Non-repeating Character in a Stream](https://github.com/JawadSher/DSA-LeetCode-GFG-Problems-Repository/tree/main/16%20-%20Queue%20Data%20Structure%20Problems/01%20-%20Linear%20Queue%20Problems/08%20-%20First%20Non-repeating%20Character%20in%20a%20Stream) | Find the first non-repeating character in a stream of characters using a queue. | Non | [Link](https://practice.geeksforgeeks.org/problems/first-non-repeating-character-in-a-stream/1) |
37+
| 09 | [Circular Tour](https://github.com/JawadSher/DSA-LeetCode-GFG-Problems-Repository/tree/main/16%20-%20Queue%20Data%20Structure%20Problems/01%20-%20Linear%20Queue%20Problems/09%20-%20Circular%20Tour) | Problem where the goal is to determine if a circular tour can be completed given a series of petrol pumps in a queue. | Non | [Link](https://practice.geeksforgeeks.org/problems/circular-tour/1) |
38+
| 10 | [Interleave The First Half of The Queue With Second Half](https://github.com/JawadSher/DSA-LeetCode-GFG-Problems-Repository/tree/main/16%20-%20Queue%20Data%20Structure%20Problems/01%20-%20Linear%20Queue%20Problems/10%20-%20Interleave%20The%20First%20Half%20of%20The%20Queue%20With%20Second%20Half) | Problem where the first half of the queue is interleaved with the second half. | Non | [Link](https://www.geeksforgeeks.org/problems/interleave-the-first-half-of-the-queue-with-second-half/1?itm_source=geeksforgeeks&itm_medium=article&itm_campaign=practice_card) |
39+
| 11 | [Implement k Queues in a Single Array](https://github.com/JawadSher/DSA-LeetCode-GFG-Problems-Repository/tree/main/16%20-%20Queue%20Data%20Structure%20Problems/01%20-%20Linear%20Queue%20Problems/11%20-%20Implement%20k%20Queues%20in%20a%20Single%20Array) | Problem focused on implementing multiple queues in a single array. | Non | [Link](https://www.geeksforgeeks.org/efficiently-implement-k-queues-single-array/) |
40+
| 12 | [Sum of Minimum and Maximum Elements of All Subarrays of Size K](https://github.com/JawadSher/DSA-LeetCode-GFG-Problems-Repository/tree/main/16%20-%20Queue%20Data%20Structure%20Problems/01%20-%20Linear%20Queue%20Problems/12%20-%20Sum%20of%20Minimum%20and%20Maximum%20Elements%20of%20All%20Subarrays%20of%20Size%20K) | Calculate the sum of the minimum and maximum elements of all subarrays of size K in a queue. | Non | [Link](https://www.geeksforgeeks.org/sum-minimum-maximum-elements-subarrays-size-k/) |
41+
42+
43+
---
44+
Happy Coding 😊

0 commit comments

Comments
 (0)