Use app×
Join Bloom Tuition
One on One Online Tuition
JEE MAIN 2025 Foundation Course
NEET 2025 Foundation Course
CLASS 12 FOUNDATION COURSE
CLASS 10 FOUNDATION COURSE
CLASS 9 FOUNDATION COURSE
CLASS 8 FOUNDATION COURSE
0 votes
128 views
in Computer by (55.2k points)
closed by

क्यू (Queue) के बुनियादी ऑपरेशन कौन से है? किसी एक का वर्णन कीजिए।

1 Answer

+1 vote
by (57.2k points)
selected by
 
Best answer

क्यू के बुनियादी ऑपरेशन : क्यू ऑपरेशन का उपयोग क्यू को इनिशलायजिंग और डीइनिशलायजिंग करने के लिए किया जाता है। निम्नलिखित क्यू के बुनियादी ऑपरेशन है।

enqueue () – एक तत्त्व क्यू में जोड़ना
dequeue () – एक तत्त्व क्यू से हटाना

एनक्यू (Enqueue) ऑपरेशन – क्यू में दो डाटा पॉइंटर फ्रंट और रियर होते है इसलिए इसके ऑपरेशन स्टैक से कठिन होते है। क्यू में डाटा तत्त्व को जोड़ने (insert) के लिए निम्नलिखित स्टेप्स का उपयोग करते हैं।

Step 1 – Check if the queue if full.
Step 2 – If the queue is full, produce overflow error and exit.
Step 3 – If the queue is not full, increment rear pointer to point the next empty space.
Step 4 – Add data element to the queue location, where the rear is pointing.
Step 5 – return success.

एनक्यू (Enqueue) ऑपरेशन के लिए एल्गोरिथ्म

procedure enqueue (data)
if queue is full
return overflow
endif
rear←rear +1
queue[rear]←data
return true
end procedure

एनक्यू (Enqueue) ऑपरेशन की C भाषा में इम्प्लीमेंटेशन

int enqueue (int data)
if(isfull())
return 0;
rear=rear +1;
queue[rear] = data;
return 1;
end procedure

Welcome to Sarthaks eConnect: A unique platform where students can interact with teachers/experts/students to get solutions to their queries. Students (upto class 10+2) preparing for All Government Exams, CBSE Board Exam, ICSE Board Exam, State Board Exam, JEE (Mains+Advance) and NEET can ask questions from any subject and get quick answers by subject teachers/ experts/mentors/students.

Categories

...