Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

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 stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #Reverse #Linked #List
ADD COMMENT
Topic
Name
4+2 =