Home > Back-end >  List of operation how to implement these
List of operation how to implement these

Time:10-28

Typedef int ElementType;
The class LinkList
{
Private:
The class Node
{
Public:
ElementType data;
Node * next;
The Node () : the next (0) {}//the default constructor
The Node (ElementType dataValue) : data (dataValue), next (0) {}//value constructor
};
Public:
Typedef Node * NodePointer;
LinkList ();//the constructor
LinkList (const LinkList & amp; OrigList);//copy constructor
~ LinkList ();//destructors
//void release ();
Const LinkList & amp; Operator=(const LinkList & amp; RightSide);//the assignment operator overloading
Bool empty ();//the list to empty
Void insert (ElementType dataVal, int index);//the location specified in the list insert node
Void erase (int index);//delete specify the location of the node in the linked list
NodePointer search (ElementType dataVal);//the node specified values in the table lookup chain
Void the display (ostream & amp; Out) const;//output list node values
Int nodeCount ();//computing nodes is
Void reverse ();//list the reversal of the end nodes into a linked list first node
Bool ascendingOrder ();//determine whether a linked list in ascending order
Void ListMerge (LinkList & amp; Templist);//list B incorporated into the list at the end of A void MergeList (LinkList & amp; ListA, LinkList & amp; By);//the list A and list B on the merger to list C ElementType get (NodePointer temp);
Private:
NodePointer first;//a pointer to the first node
Int mySize;//the node number
  • Related