Hey, I am so delighted to say that I was able to take the next step in my competitive programming journey. I started from knowing nothing about linked lists and have now begun learning some of the tougher concepts. After covering the basics, I moved on to more complicated topics. I’ve learned about linked lists and tackled a few related questions over the past few days. Today, I focused on Dojo-related questions, as I need them for my upcoming dojo this week. I made a plan with that in mind.
All activities about linked list operations were set for Tuesday. Problems completed on the same day included Reverse Linked List, Design Linked List, and Insert into a Sorted Circular Linked List.
Starting with Reverse Linked List, I learned the core technique to reverse the nodes of a singly linked list. I worked through an iterative approach of keeping track of the previous and next nodes while traversing the list and updating pointers accordingly. I also experimented with the recursive solution, which seemed elegant but required some clarity about how recursion was affecting the stack.
Design Linked List forced me to implement a basic linked list from scratch and came up with various operations, adding and deleting elements at some specified index. It has sub-goals like designing the Node class as well as handling the head or tail additions when attempting to add beyond the currently set bounds of the list. This problem was great for cementing my understanding of linked list mechanics and exposing common implementation pitfalls.
Lastly, I worked on Insert into a Sorted Circular Linked List. The nature of the circular list added an extra layer of complexity as I had to worry about edge cases like inserting into an empty list or into positions that wrap around the list. I used a traversal loop to find the appropriate position and carefully updated the pointers to maintain the circular structure. This problem tested my ability to think critically about pointer manipulation and edge case handling.
By the end of the day, I felt more confident in my linked list skills and excited about tackling more challenging variations in the future.
Top comments (0)