Given a linked list, this algorithm determines whether or not the list is a palindrome.

172

Nov 30
This problem asks you to reverse the order of a linked list. For example, if the given linked list is 1->2->3->4->5, the output should be 5-> 4->3->2->1.

178

Nov 29
To determine whether or not a linked list is a palindrome, we can use a stack to keep track of the first half of the list. As we iterate through the list, we push each node onto the stack. Once we reach the end of the list, we compare the second half of the list to the nodes in the stack, popping each node off the stack as we compare. If the list is a palindrome, the stack will be empty at the end.

172

Nov 28
To reverse a linked list in place, we need to keep track of the current node, as well as the previous and next nodes. We can then change the pointers of the current node to point to the previous node, and move on to the next node.

172

Nov 26
This problem deals with removing duplicate elements from a linked list. An example input and output are given.

168

Nov 26
This problem asks you to reverse a linked list. An example input and output is given.

162

Nov 25
This problem asks whether a singly linked list is a palindrome, meaning that the data in the list is the same forwards as it is backwards. An example input is provided, along with the expected output.

218

Nov 23
Given a singly linked list, this function will delete the head node and return the new head node.

183

Nov 23