LL1.cpp
bool LL1::remove(int x){
	Node *p = head;
	Node *temp;
	// Check to see if the list exists
	if (head == NULL){
		return false;
	}
	// Check to see if target is at the head of the list
	else if (head->data == x){
		head = head->next;
		delete p; //currently assigned head
		size--;
		return true;
	}
	// Otherwise iterate through list
	else{
		while(p->next != NULL){
			// Check next node for target
			if(p->next->data == x){
				temp = p->next;
				p->next = p->next->next;
				delete temp;
				return true;
			}
			p = p->next;
		}
	}
	return false;
}
// Removes the first node containing the given data, returns true
// iff data is found (and deleted).

Removes the first node containing the given data, returns true
iff data is found (and deleted).
Removes the first node containing the given data returns true iff data is found ( and deleted ) .
bool LL1::remove(int x){
	Node *p = head;
	Node *temp;
	if (head == NULL){
		return false;
	}
	else if (head->data == x){
		head = head->next;
		delete p; 
		size--;
		return true;
	}
	else{
		while(p->next != NULL){
			if(p->next->data == x){
				temp = p->next;
				p->next = p->next->next;
				delete temp;
				return true;
			}
			p = p->next;
		}
	}
	return false;
}
bool LL1 :: remove ( int x ) { Node * p = head ; Node * temp ; if ( head == NULL ) { return false ; } else if ( head -> data == x ) { head = head -> next ; delete p ; size -- ; return true ; } else { while ( p -> next != NULL ) { if ( p -> next -> data == x ) { temp = p -> next ; p -> next = p -> next -> next ; delete temp ; return true ; } p = p -> next ; } } return false ; }
Removes the first node containing the given data, returns true
iff data is found (and deleted).
Removes the first node containing the given data returns true iff data is found ( and deleted ) .
// Check to see if the list exists
 // Check to see if target is at the head of the list
 //currently assigned head
 // Otherwise iterate through list
 // Check next node for target
