1154 Data Structures and Collections Chapter 23 145 (Cheapest web hosting)

1154 Data Structures and Collections Chapter 23 145 // loop while current node is not lastNode 146 while ( current.Next != lastNode ) 147 current = current.Next; // move to next node 148 149 // current is new lastNode 150 lastNode = current; 151 current.Next = null; 152 } 153 154 return removeItem; // return removed data 155 } 156 } 157 158 // return true if List is empty 159 public bool IsEmpty() 160 { 161 lock ( this ) 162 { 163 return firstNode == null; 164 } 165 } 166 167 // output List contents 168 virtual public void Print() 169 { 170 lock ( this ) 171 { 172 if ( IsEmpty() ) 173 { 174 Console.WriteLine( “Empty ” + name ); 175 return; 176 } 177 178 Console.Write( “The ” + name + ” is: ” ); 179 180 ListNode current = firstNode; 181 182 // output current node data while not at end of list 183 while ( current != null ) 184 { 185 Console.Write( current.Data + ” ” ); 186 current = current.Next; 187 } 188 189 Console.WriteLine( “n” ); 190 } 191 } 192 193 } // end class List 194 Fig. 23.4 Fig. 23.4Fig. 23FiFi.4g. 23.4g.23.4Definitions of classes ListNode, Listand EmptyListException. (Part 4 of 5.)
Note: If you are looking for high quality webhost to host and run your jsp application check Vision christian web host services

Leave a Reply