Computer Science Fundamentals (CS153 2004S)
[Skip to Body]
Primary:
[Front Door]
[Current]
[Glance]
-
[Honesty]
[Instructions]
[Links]
[Search]
Groupings:
[EBoards]
[Examples]
[Exams]
[Handouts]
[Homework]
[Labs]
[Outlines]
[Readings]
[Reference]
Misc:
[Experiments in Java]
[Java API]
[Scheme Reference]
[Scheme Report]
[CS153 2003S]
[CS151 2003F]
[CS152 2000F]
[SamR]
Back to Determining Position Validity. On to Linear Structures.
Held: Thursday, 22 April 2004
Summary:
Today we consider how to build lists from nodes
, which are
much like Scheme pairs. Such lists are typically called
linked lists.
Related Pages:
Overview:
isValid.invalidateall extant positions in the list.
isValid?
/**
* Nodes used to build linked lists. In Saul's words, "These are
* really structures."
*
* @author Samuel A. Rebelsky
*/
class ListNode
implements Position
{
/**
* The contents of the node. Should never be null.
*/
Object contents;
/**
* The next node in the list. Should be null for the last
* element of the list.
*/
ListNode next;
/**
* Build a new node with a subsequent list.
*/
public ListNode(Object contents, ListNode next)
{
this.contents = contents;
this.next = next;
} // ListNode(Object, ListNode)
/**
* Build a new node with no successor.
*/
public ListNode(Object contents)
{
this(contents, null);
} // ListNode(Object)
} // class ListNode
Back to Determining Position Validity. On to Linear Structures.
[Skip to Body]
Primary:
[Front Door]
[Current]
[Glance]
-
[Honesty]
[Instructions]
[Links]
[Search]
Groupings:
[EBoards]
[Examples]
[Exams]
[Handouts]
[Homework]
[Labs]
[Outlines]
[Readings]
[Reference]
Misc:
[Experiments in Java]
[Java API]
[Scheme Reference]
[Scheme Report]
[CS153 2003S]
[CS151 2003F]
[CS152 2000F]
[SamR]
Disclaimer:
I usually create these pages on the fly
, which means that I rarely
proofread them and they may contain bad grammar and incorrect details.
It also means that I tend to update them regularly (see the history for
more details). Feel free to contact me with any suggestions for changes.
This document was generated by
Siteweaver on Fri May 7 09:43:32 2004.
The source to the document was last modified on Tue Jan 13 10:26:12 2004.
This document may be found at http://www.cs.grinnell.edu/~rebelsky/Courses/CS153/2004S/Outlines/outline.46.html.
You may wish to
validate this document's HTML
;
;
Check with Bobby