{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

day20 - COP 3503 Computer Science II CLASS NOTES DAY#20...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
COP 3503 – Computer Science II CLASS NOTES - DAY #20 General Characteristics Allow general access (i.e., not constrained to the beginning or end of the list as with a stack or a queue). Consists of dynamically allocated nodes (containing both a data section and a reference section) that are connected together. Singly Linked List Each node contains a reference to the “next” node in the list. The last node in the list contains a reference to null , indicating that it is the last node in the list. Movement through the list is uni-directional, i.e., one-way. null head Recall that the basic operations that are needed on a linked list are: insert, delete, and find at the minimum, but “helper” operations are extremely useful. Java Implementation //definition of a node class public class Node { public Object data; public Node next; private Node ( ) { } //defeats improper instantiation public Node (Object x) //constructor for Node alpha = new Node (x); { data = x; next = null; } //end constructor
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}