CS 240 Lecture Notes - Lecture 10: Stack (Abstract Data Type), Doubly Linked List, Linked List

77 views14 pages

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.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents