EECS 280 Lecture 17: Linked Lists

60 views3 pages

Document Summary

The compiler will not let you override a function differing in return type - only with different parameters. Idea that you can keep growing these structures - keep adding on information to them. Pros: fast indexing and pointer arithmetic under the hood. Cons: increasing capacity requires creating a new array - allocating more memory. Con - we have to allocate more memory because now we would have the information and the pointer that points to it. Each piece of the list contains a datum but also a next pointer containing the address of the next piece. Here, we"re using structs to represent the nodes. There"s a pointer to the next piece of the list. We can create a class object called list that contains all of these nodes, and here we can add member functions that let us edit them. can add member functions that let us edit them.

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