Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

Reverse a Linked List

void reverse()
	{
		node* current, * prev, * temp;
		current = head;
		prev = NULL;
		while (current != NULL)
		{
			temp = current->next;
			current->next = prev;
			prev = current;
			current = temp;
		}
		head = prev;
	}
Source by www.faceprep.in #
 
PREVIOUS NEXT
Tagged: #Reverse #Linked #List
ADD COMMENT
Topic
Name
3+1 =