CSC148H5 Lecture Notes - Lecture 8: Linked List, If And Only If

46 views1 pages
1 Apr 2018
School
Course

Document Summary

Linked lists i we"ll implement our own list adt using a linked list i we will use two classes for our implementation. I node: allows us to string together elements of a list i. Linkedlist: stores a reference to the first node in the list, plus other attributes to make some list operations faster. I let"s write functions to add to the beginning or end of a chain of nodes i. We can quickly add to the beginning i. I adding to the end of a chain of nodes requires us to find the last node i this search is why adding to the end is slow! I so, let"s just keep a reference to that last node i we will store in our linkedlist objects i. Reference to front (first) node i reference to back (last) node i number of elements in linked list.

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

Related Questions