Chapter 23 Data Structures and Collections 1155 195 (Web design company)

Chapter 23 Data Structures and Collections 1155 195 // class EmptyListException definition 196 public class EmptyListException : ApplicationException 197 { 198 public EmptyListException( string name ) 199 : base( “The ” + name + ” is empty” ) 200 { 201 } 202 203 } // end class EmptyListException 204 205 } // end namespace LinkedListLibrary Fig. 23.4 Fig. 23.4Fig. 23FiFi.4g. 23.4g.23.4Definitions of classes ListNode, Listand EmptyListException. (Part 5 of 5.) 1 // Fig 23.5: ListTest.cs 2 // Testing class List. 3 4 using System; 5 using LinkedListLibrary; 6 7 namespace ListTest 8 { 9 // class to test List class functionality 10 class ListTest 11 { 12 static void Main( string[] args ) 13 { 14 List list = new List(); // create List container 15 16 // create data to store in List 17 bool aBoolean = true; 18 char aCharacter = ‘$’; 19 int anInteger = 34567; 20 string aString = “hello”; 21 22 // use List insert methods 23 list.InsertAtFront( aBoolean ); 24 list.Print(); 25 list.InsertAtFront( aCharacter ); 26 list.Print(); 27 list.InsertAtBack( anInteger ); 28 list.Print(); 29 list.InsertAtBack( aString ); 30 list.Print(); 31 32 // use List remove methods 33 object removedObject; 34 Fig. 23.5 Fig. 23.FiFig. 23.5g. 23.5Demonstrating the linked list. (Part 1 of 2.) Fig. 23.5
Note: If you are looking for best quality webspace to host and run your tomcat application check Vision tomcat hosting services

Leave a Reply