LL1.cpp
void LL1::printList(){
	Node *p = head;
	cout << "["; //Nice format!
	// Traverse the list
	while (p != NULL){
		cout << p -> data; // Print data
		p = p -> next; // Go to next node
		if (p != NULL){
			cout << ","; // Print a comma unless at the end of the list
		}
	}
	cout << "]"; // Don't print a newline - it might not be wanted
}
// Prints the entire list (head first) to the screen.
/* Note that there is some debate about whether or not this type of
 * method belongs in a class.  The argument (briefly) is that a class
 * shouldn't be responsible for its own display as it cannot foresee
 * how it is to be displayed. */
Prints the entire list (head first) to the screen.
Note that there is some debate about whether or not this type of
method belongs in a class.  The argument (briefly) is that a class
shouldn't be responsible for its own display as it cannot foresee
how it is to be displayed.
Prints the entire list ( head first ) to the screen . Note that there is some debate about whether or not this type of method belongs in a class . The argument ( briefly ) is that a class shouldn ' t be responsible for its own display as it cannot foresee how it is to be displayed .
void LL1::printList(){
	Node *p = head;
	cout << "["; 
	while (p != NULL){
		cout << p -> data; 
		p = p -> next; 
		if (p != NULL){
			cout << ","; 
		}
	}
	cout << "]"; 
}
void LL1 :: printList ( ) { Node * p = head ; cout << " " ; while ( p != NULL ) { cout << p -> data ; p = p -> next ; if ( p != NULL ) { cout << " " ; } } cout << " " ; }
Prints the entire list (head first) to the screen.
Prints the entire list ( head first ) to the screen .
//Nice format!
 // Traverse the list
 // Print data
 // Go to next node
 // Print a comma unless at the end of the list
 // Don't print a newline - it might not be wanted
