Exercise 3.23: Write API for doubly-linked lists