import java.util.Scanner; public class Driver { public static void main(String [] args) { Manager listManager = new Manager(); Scanner in = new Scanner(System.in); /* First list operation: display list */ // Display case 1: Empty list listManager.display(); // Display case 2: Non-empty list listManager.add(); listManager.add(); listManager.add(); listManager.display(); /* Second list operation: destroy entire list */ listManager.eraseList(); listManager.display(); /* Third list operation: add/insert */ listManager.add(); // Add to empty list listManager.display(); System.out.println(); listManager.add(); // Add to 1 node list listManager.display(); System.out.println(); listManager.add(); // Add to 2 node list listManager.display(); System.out.println(); System.out.print("Hit enter to continue"); in.nextLine(); /* Fourth list operation: remove/delete */ // Case 1 listManager.eraseList(); // Blows away entire list listManager.display(); System.out.println("List empty, calling remove()"); listManager.remove(); // Remove element from empty // Case 2A: remove first node listManager.add(); listManager.add(); listManager.add(); listManager.remove(); listManager.display(); System.out.print("Hit enter to continue"); in.nextLine(); // Case 2B: remove any but first listManager.add(); // make list 3 elements again listManager.remove(); listManager.display(); System.out.print("Hit enter to continue"); in.nextLine(); // Case 3: no match listManager.remove(); listManager.display(); System.out.print("Hit enter to continue [rec display coming]"); in.nextLine(); // Recursive display: extra section, end of list section listManager.displayRecursive(); // Advanced application of recursion: extra practice //listManager.displayReverse(); } }