We now return to lists and trees and consider what it will take to make them generic the way we make generic dynamic arrays in Chapter 10. The techniques we used there, working with void pointers or generating code using macros, will also work with lists and trees, but we will take a different approach.
With lists and trees, we are not working with contiguously allocated chunks of memory, so in principle, links and nodes can have any size. A generic data structure needs to know about the bits that define a link or a node, but if we allocate memory to store additional data alongside ...