Difference between revisions of "CSC212 Lab 6 Solutions 2014"

From dftwiki3
Jump to: navigation, search
Line 41: Line 41:
 
tail.next = new IntSLLNode( el );
 
tail.next = new IntSLLNode( el );
 
tail = tail.next;
 
tail = tail.next;
 +
                        length++;
 
}
 
}
length++;
+
 
}
 
}
 
 
Line 65: Line 66:
 
System.out.println( "+===========================================\n| List:");
 
System.out.println( "+===========================================\n| List:");
 
System.out.println( isEmpty()? "| is empty": "| is not empty" );
 
System.out.println( isEmpty()? "| is empty": "| is not empty" );
System.out.println( "| contains " + length + " elements" );
+
System.out.println( "| contains " + length + " element" + ((length!=1)? "s":"" ) );
 
System.out.print( "| elements: " );
 
System.out.print( "| elements: " );
 
printAll();
 
printAll();

Revision as of 12:25, 1 October 2014

--D. Thiebaut (talk) 13:04, 1 October 2014 (EDT)




...