We dont really need a real one-past-the-end Link for a list. Modify your solution to the previous

Question:

We don’t really need a “real” one-past-the-end Link for a list. Modify your solution to the previous exercise to use 0 to represent a pointer to the (nonexistent) one-past-the-end Link (list::end()); that way, the size of an empty list can be equal to the size of a single pointer.


Data from Previous Exercise

Complete the definition of list from §20.4.1–2 and get the high() example to run. Allocate a Link to represent one past the end.

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question
Question Posted: