CMPT 115 Lecture Notes - Lecture 7: Linked Data, Pseudocode, Null Pointer
4 pages18 viewsWinter 2016
Course CodeCMPT 115
This preview shows page 1. to view the full 4 pages of the document.
Pre-Lists: Getting the hang of linked data structures
CMPT 115 lecture notes
Notes written by Michael Horsch, Mark Eramian, Ian McQuillan, Lingling Jin, and Dmytro Dyachuk
After this topic, students are expected to
1. Explain the way records can link to records of the same type
2. Use linked records in simple expressions.
3. Draw diagrams of linked records.
4. Use linked records in simple algorithms.
Element data; // placeholder type
refToNode next; // points to another node
•Anode record can link one node to another node.
•We’ll need a node record for each element in a list.
•Element is a placeholder type ; we’ll see examples that store integers or strings. . . Focus on the linking,
not the data here!
You're Reading a Preview
Unlock to view full version
Loved by over 2.2 million students
Over 90% improved by at least one letter grade.