You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Furkan Türkal c4eb407e2c
[test] added unit test for linked-list-reverse
5 years ago
..
README.md update readme 7 years ago
linked-list-reverse.go added linked-list-reverse 7 years ago
linked-list-reverse_test.go [test] added unit test for linked-list-reverse 5 years ago

README.md

LinkedList Reverse Source

What It Is

What It Is

Given pointer to the head node of a linked list, the task is to reverse the linked list. We need to reverse the list by changing links between nodes.

  • Input: Head of following linked list [1->2->3->4->NULL]
  • Output: Linked list should be changed to [4->3->2->1->NULL]
  • Input: Head of following linked list [1->2->3->4->5->NULL]
  • Output: Linked list should be changed to [5->4->3->2->1->NULL]

Algorithm Complexity

Complexity Notation
Time Complexity O(n)
Auxiliary Space O(1)