This video lecture explains box-and-pointer diagrams, which are a visual model for objects, variables and references. Box-and-pointer diagrams are also important for understanding and explaining data structures. We’ll develop the ideas behind box-and-pointer diagrams by thinking about how programs use memory.
We have the idea of an abstract data type (ADT) — a data type which is defined by its set of possible values and set of supported operations, but which does not specify how those values should be represented in memory, nor how the operations should be implemented. We also have a memory model for thinking about data structures, which fill in these details.(1)
Computer programs use variables and data structures to store data in memory.(1) A data structure is a scheme for representing values of some type in memory; before we can understand, analyse and design data structures, we need to understand memory.