Exemplo n.º 1
0
 private int countItems(LinkListNode useNode)
 {
     if (useNode != null)
     {
         return(1 + countItems(useNode.nextNode));
     }
     else
     {
         return(0);
     }
 }
Exemplo n.º 2
0
 private void AddNode(string newData, LinkListNode useNode)
 {
     if (useNode.nextNode == null)
     {
         useNode.nextNode = new LinkListNode(newData);
     }
     else if (useNode.nextNode.data == newData && _rejectNonUnique == true)
     {
         return;
     }
     else if (AbeforeB(newData, useNode.nextNode.data))
     {
         LinkListNode nnode = new LinkListNode(newData);
         nnode.nextNode   = useNode.nextNode;
         useNode.nextNode = nnode;
     }
     else
     {
         AddNode(newData, useNode.nextNode);
     }
 }
Exemplo n.º 3
0
 public void AddNode( string newData )
 {
     if ( firstNode == null )
     {
         firstNode = new LinkListNode( newData );
         return;
     }
     else if ( firstNode.data == newData && _rejectNonUnique == true )
     {
         return;
     }
     if ( AbeforeB( newData, firstNode.data ) )
     {
         LinkListNode nnode = new LinkListNode( newData );
         nnode.nextNode = firstNode;
         this.firstNode = nnode;
     }
     else
     {
         AddNode( newData, firstNode );
     }
 }
Exemplo n.º 4
0
 public void AddNode(string newData)
 {
     if (firstNode == null)
     {
         firstNode = new LinkListNode(newData);
         return;
     }
     else if (firstNode.data == newData && _rejectNonUnique == true)
     {
         return;
     }
     if (AbeforeB(newData, firstNode.data))
     {
         LinkListNode nnode = new LinkListNode(newData);
         nnode.nextNode = firstNode;
         this.firstNode = nnode;
     }
     else
     {
         AddNode(newData, firstNode);
     }
 }
Exemplo n.º 5
0
 public void deleteChild( )
 {
     LinkListNode newChild = this.nextNode.nextNode;
     this.nextNode.nextNode = null;
     this.nextNode = newChild;
 }
Exemplo n.º 6
0
 private string printList( LinkListNode useNode )
 {
     return useNode != null ? useNode.data + "\n" + printList( useNode.nextNode ) : "";
 }
Exemplo n.º 7
0
 private int countItems( LinkListNode useNode )
 {
     if ( useNode != null )
     {
         return 1 + countItems( useNode.nextNode );
     }
     else
     {
         return 0;
     }
 }
Exemplo n.º 8
0
 private void AddNode( string newData, LinkListNode useNode )
 {
     if ( useNode.nextNode == null )
     {
         useNode.nextNode = new LinkListNode( newData );
     }
     else if ( useNode.nextNode.data == newData && _rejectNonUnique == true )
     {
         return;
     }
     else if ( AbeforeB( newData, useNode.nextNode.data ) )
     {
         LinkListNode nnode = new LinkListNode( newData );
         nnode.nextNode = useNode.nextNode;
         useNode.nextNode = nnode;
     }
     else
     {
         AddNode( newData, useNode.nextNode );
     }
 }
Exemplo n.º 9
0
 public void clearList()
 {
     firstNode=null;
 }
Exemplo n.º 10
0
 public void clearList()
 {
     firstNode = null;
 }
Exemplo n.º 11
0
 private string printList(LinkListNode useNode)
 {
     return(useNode != null ? useNode.data + "\n" + printList(useNode.nextNode) : "");
 }