CMPT 115 Lecture Notes - Lecture 7: Linked Data, Pseudocode, Null Pointer

41 views4 pages
9 May 2016
School
Course
Professor

Document Summary

Pre-lists: getting the hang of linked data structures. Notes written by michael horsch, mark eramian, ian mcquillan, lingling jin, and dmytro dyachuk. After this topic, students are expected to: explain the way records can link to records of the same type, use linked records in simple expressions, draw diagrams of linked records, use linked records in simple algorithms. Element data; reftonode next; // points to another node. Focus on the linking, not the data here! Draw a diagram for the following pseudo-code sequence: Node *x allocate new node x data 5 x next null. Node *y allocate new node y data 1 y next x. Node *z allocate new node z data 8 z next y print (z data) print (z next data) print (z next next data) Remember: x data means (*x). data, x next means (*x). next data next. Node *x allocate new node x data this x next 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