Question

3. How can you implement a queue data structure using a doubly linked list? Do you think it is necessary to use a doubly link

0 0
Add a comment Improve this question Transcribed image text
Answer #1

implementing queue using doubly linked list.

declare two pointer (rear and front) of doubly node type .

rear point to last node of queue and front point to first node of queue.

enqueue(data) : new data will be inserted into doubly linked list at rear end.

dequeue(data) will be done at front of (head)doubly linked list.

isEmpty(): if head of linked list is NULL then it is empty.

frontElement() : print data at head of doubly linked list.

No,it is not necessary to use doubly linked list ,it can be implemented using singly linked list.

doubly linked list occupy more memory than singly linked list.

Therefore ,it would be better to use singly linked list.

Add a comment
Know the answer?
Add Answer to:
3. How can you implement a queue data structure using a doubly linked list? Do you think it is necessary to use a doubl...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT