CS 1337 Lecture Notes - Lecture 20: Linked List

21 views3 pages

Document Summary

// description : hello world in c++, ansi-style. * linked list : set of data structures that contain references to other data structures. * each node points to another node in the list. * use the address of a node (dynamically allocated nodes) * use the index of a node (using another data structure such as an array) * we can add new nodes into the list during program execution. * arrays - fixed size (moderately difficult to change size), inserting node in middle is also very expensive. * linked list - can grow as big or small as it needs, inserts nodes in a very efficient manner. * vectors - can also grow but to insert node in middle of vector is very expensive. * declare instance of list class mylist { * one or more data fields i want to store. * payload of the node, the data stored in node double data; struct node { public:

Get access

Grade+
$40 USD/m
Billed monthly
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
10 Verified Answers
Class+
$30 USD/m
Billed monthly
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
7 Verified Answers

Related Documents