Exercises
We will resolve one exercise from LeetCode so we can learn another concept we have not covered in this chapter so far.
However, there are many fun linked list exercises available in LeetCode that we should be able to resolve with the concepts we learned in this chapter. Below are some additional suggestions you can try to resolve, and you can also find the solution along with the explanation within the source code from this book:
- 2. Add Two Numbers: traverse two linked list and sum each number.
- 62. Rotate List: remove nodes from the tail and prepend them in the list.
- 203. Remove Linked List Elements: traverse the list and check for the value that needs to be removed. Tip: keep a previous reference to make the removal easier.
- 234. Palindrome Linked List: check if the elements of the list are a palindrome.
- 642. Design Circular Deque: implement the deque data structure.
- 622. Design Circular Queue implement the queue data structure.
Reverse Linked List
The exercise we will resolve...