Problem

(List and Queues without Tail Pointers) Our implementation of a linked list (Figs. 19.4–19...

(List and Queues without Tail Pointers) Our implementation of a linked list (Figs. 19.4–19.5) used both a firstPtr and a lastPtr. The lastPtr was useful for the insertAtBack and removeFromBack member functions of the List class. The insertAtBack function corresponds to the enqueue member function of the Queue class. Rewrite the List class so that it does not use a lastPtr. Thus, any operations on the tail of a list must begin searching the list from the front. Does this affect our implementation of the Queue class (Fig. 19.16)?

Fig.19.4 ListNode class-template definition.

Fig.19.5 List class-template definition. (Part 1 of 4.)

Fig.19.5 List class-template definition. (Part 2 of 4.)

Fig. 19.5 List class-template definition. (Part 3 of 4.)

Fig. 19.5 List class-template definition. (Part 4 of 4.)

Fig. 19.16 Queue class-template definition. (Part 1 of 2.)

Fig.19.16 Queue class-template definition. (Part 2 of 2.)

Step-by-Step Solution

Request Professional Solution

Request Solution!

We need at least 10 more requests to produce the solution.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the solution will be notified once they are available.
Add your Solution
Textbook Solutions and Answers Search
Solutions For Problems in Chapter 20
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