What is Queue in Data Structure and type of Queue
Queue : Data structure Kya hota hai topic को लास्ट पोस्ट मे explain किया जा चूका है| Data structure की एक category liner data structure होती है जिसमे डाटा को एक specific order follow करते हुए store करते है| queue एक लीनियर डाटा structure है जिसमे डाटा एलिमेंट्स का deletion केवल एक end से होता है जिसको फ्रंट कहा जाता है जबकि डाटा एलिमेंट insertion दूसरे एन्ड से होता है जिसे rear कहा जाता है | क्यू मे जो एलिमेंट सबसे पहले insert किया जाता है वही एलिमेंट queue से सबसे पहले रिमूव होता है इसलिए कहा जाता है की Queue FIFO (First In First Out) structure को follow करती है| क्यू का एक end जिससे element insert किया जाता है उस process को enqueue एवं remove किये जाने वाले process को dequeue कहते है |
क्यू रियल life example – अगर किसी काम के लिए लोग queue मे लगे हुए है एवं अपनी बारी का wait कर रहे है तो जो व्यक्ति सबसे पहले लाइन मे लगा था उसका number भी सबसे पहले आएगा और उसका काम सबसे पहले होगा| इसका मतलब पहले आओ पहले पाओ or First in first out |
Read Also – What is Stack (LIFO)
Technology मे क्यू का example – Printing Task, disk storage access करने मे, CPU scheduling, Disk Scheduling एवं CPU के time sharing system मे भी क्यू का काम होता है | इसका मतलब technology मे क्यू का उपयोग तब किया जाता है जब बहुत सारे programs क्यू मे होते है और एक एक task को number से execute होना होता है|

What is queue in data Structure
क्यू features –
- क्यू, एलिमेंटस की ordered लिस्ट है जिसमे सिमिलर डाटा types होते है|
- क्यू FIFO( First in First Out ) structure होता है|
- क्यू मे अगर एक एलिमेंट ‘X’ add किया जाता है तो इस ‘X’ element को queue से remove करने के लिए ‘X’ से पहले insert किये गए सारे elements रिमूव करने होंगे|
क्यू Operations – Four basic operations –
- Enqueue : एलिमेंट को add करने के process को Enqueue कहते है|
- Dequeue : एलिमेंट को remove करने के process को Dequeue कहा जाता है|
- Front: क्यू का first item लेना|
- Rear: क्यू से last item लेना |
Functions of Basic Operations – Main functions of क्यू are –
- enqueue() − एक एलिमेंट ऐड करने के लिए|
- dequeue() − एक एलिमेंट को रिमूव करने के लिए|
- peek() − एलिमेंट को रिमूव किये बिना फ्रंट से एक्सेस करने के लिए|
- isfull() − क्यू का स्टेटस चेक करने के लिए की यह फुल है या नहीं|
- isempty() − क्यू का स्टेटस चेक करने के लिए की यह empty है या नहीं|
types of Queue:
1. Simple
2. Circular
3. Priority
4. Dequeue (Double Ended)
Read Also – What is Array
Read Also – What is Object Oriented Programming
Read Also – What is Polymorphism
Read Also – What is C Programming language
Read Also – What is OOPs
Read Also – What is Programming language
Click here to read Differences between C and C++ Programming Languages
Read Also – What is Data Structure
Read Also – What is Linked List
What about Real time examples of LILO (Last in Last Out)….?? Please suggest
Same as queue real life example ” bad me aao , bad me pao ” or last in last out