slistnode.jshl
来自「试验 试验 试验 试验 试验 试验 试验 试验 试验 试验 试验 试验 试验 试」· JSHL 代码 · 共 49 行
JSHL
49 行
//--------------------------------------------------------------------
//
// Laboratory 7 SListNode.jshl
//
// Class definition for the singly linked list implementation of
// the List ADT
//
// The student is to complete all missing or incomplete method
// implementations for each class (SList and SListNode)
//
//--------------------------------------------------------------------
class SListNode
{
// Data members
private Object element; // List element
private SListNode next; // Reference to the next element
// Constructor
SListNode ( Object elem, SListNode nextPtr )
// Creates a list node containing element elem and next pointer
// nextPtr.
{
}
// Class Methods used by client class
SListNode getNext( ) // Return reference to next element
{
}
SListNode setNext( SListNode nextVal ) // Set reference to next element
{ // & return that reference
}
Object getElement( ) // Return the element in the current node
{
}
void setElement(Object newElem) // Set current element to newElem
{
}
} // class SListNode
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?