Page 155 - DCAP407_DATA_STRUCTURE
P. 155
Data Structure
(d) In priority queue, the elements are inserted and deleted based on
their…………………………….
3. Select a suitable choice for the following questions.
(a) What should be the value of R pointer, before inserting elements into the queue?
(i) -1
(ii) 0
(iii) 1
(iv) Is not set to any value
(b) Which among the following is a principle of queue?
(i) Last in First Out
(ii) First in First Out
(iii) Last in Last Out
(iv) First in Last Out
(c) Using which of the following operation, an item is added to the rear end of the queue?
(i) Enqueue
(ii) Dequeue
8.8 Review Questions
1. “In circular queue the insertion and deletion operations are independent of each other.” Analyze.
2. “Using double ended queues is more advantageous than using circular queues. “Discuss
3. “Stacks are different from queues.” Justify.
4. “Using priority queues is advantageous in job scheduling algorithms. “Analyze
5. Is it possible to insert an element in the front end in a queue? If yes, which method is followed?
Discuss
6. Can a basic queue be implemented to function as a dynamic queue? Discuss
7. “It is more advantageous to implement queues using linked lists. “Analyze
Answers: Self Assessment
1. (a) False (b) True (c) False
2. (a) Front, Rear (b) Decremented (c) Circular (d) Priority
3. (a) -1 (b) First in First Out (c) Dequeue
8.9 Further Readings
Lipschutz, S. (2011). Data Structures with C. Delhi: Tata McGraw-Hill.
Reddy, P. (1999). Data Structures Using C. Bangalore: Sri Nandi Publications.
http://www.brucemerry.org.za/manual/structures/circular.html
http://www.niitcrcs.com/btpc/btpc-08%20papers%5CIsha-Arrays.pdf
http://www.sqa.org.uk/e-learning/ArrayDS02CD/page_19.htm
148 LOVELY PROFESSIONAL UNIVERSITY