LinkedList/C/linkedList.c
//Function to delete at a position
Function to delete at a position
Function to delete at a position
void posdel(int pos){
	if (head == NULL){
		printf("LIST ALREADY EMPTY\n");
		return ;
	}
	int count = 0;
	struct node* ptr = head, *ptr1;
	while(count != pos && ptr -> link != NULL){
		ptr1 = ptr;
		ptr = ptr -> link;
		count++;
	}
	temp = ptr;
	ptr1 -> link = ptr -> link;
	free(temp);
}
void posdel ( int pos ) { if ( head == NULL ) { printf ( " \n " ) ; return ; } int count = 0 ; struct node * ptr = head , * ptr1 ; while ( count != pos && ptr -> link != NULL ) { ptr1 = ptr ; ptr = ptr -> link ; count ++ ; } temp = ptr ; ptr1 -> link = ptr -> link ; free ( temp ) ; }
Function to delete at a position
Function to delete at a position