Use app×
QUIZARD
QUIZARD
JEE MAIN 2026 Crash Course
NEET 2026 Crash Course
CLASS 12 FOUNDATION COURSE
CLASS 10 FOUNDATION COURSE
CLASS 9 FOUNDATION COURSE
CLASS 8 FOUNDATION COURSE
0 votes
196 views
in Computer by (55.2k points)
closed by

क्यू (Queue) के कुशलता से उपयोग के लिए प्रयुक्त फंक्शन बताइए।

1 Answer

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

क्यू के कुशलता से उपयोग के लिए निम्नलिखित फंक्शनस का उपयोग करते हैं-

Peek() – क्यू के शीर्ष डेटा तत्त्व को हटये बिना प्राप्त करना,
isfull() – क्यू के भरे होने की जाँच करना,
isempty () – क्यू के खाली होने की जाँच करना
क्यू के सपोर्टिव फंक्शनस निम्न है।
peek ()

peek() फंक्शन के लिए एल्गोरिथ्म –

begin procedure peek
return queue[front]
end procedure

peek() फंक्शन का C भाषा में इम्प्लीमेंटेशन –

Example

int peek()
{
return queue[front];
isfull() फंक्शन के लिए एल्गोरिथ्म
begin procedure isfull
ifrear equals to MAXSIZE
return true
else
return false
endif
end procedure

isfull() फंक्शन का C भाषा में इम्प्लीमेंटेशन-

bool isfull()
{
if(rear== MAXSIZE-1)
return true;
else
return false;
}

isempty () फंक्शन के लिए एल्गोरिथ्म-

being procedure isempty
if front if less than MIN OR front is greater than rear
return true
else
return false
endif
end procedure

यदि फ्रंट का मान 0 से कम है तो इसका मतलब क्यू को इनिशलायज नहीं किया है और क्यू खाली है।

isempty() फंक्शन को C भाषा में इम्प्लीमेंटेशन-

bool isempty()
{
if(front<0|| front>rear)
return true;
else
return false;

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

...