CS 240 Lecture Notes - Lecture 10: Stack (Abstract Data Type), Doubly Linked List, Linked List
Document Summary
If we had some sort of dataset and some of the requirements are: Instead of storing it contiguously we stored them separately. In order for this to work: we need a way for each node to get to the other node. Do not generally do this but we are going to make everything in the class public. For this idea to work we need a way to keep track of the start of the list. class node{ public: That is why we are using another class called list. Moore wanted us to do an exercise to model a train. We are modeling this idea of linking cars together. If we had a class called train all that we really needed was a link to the engine car* engine; class list{ We are learning how to design things not just make it work. We can have the head point to null.