Hello Everyone!
This is my final post as part of the LeetCode Weekly Challenge, after doing it for 13 weeks. It’s only fair that the last day was dedicated to Binary Search Trees, as structured thinking and precision is something I was developing throughout these weeks. Dealing with these challenges seemed like a string of puzzles explored in an enviable system—I have definitely progressed a lot.
Events for the Day
-
Search in a Binary Search Tree (Easy Difficulty)
– This operation takes a node in a BST and returns the subtree of a node.
-
The Strategy:
- Traversed the tree using the properties of BSTs: changing right or left as the case may be in relation to comparisons. – Returned the node when the value matched or None if it was not found.
- The Fun Part: I found it rather enjoyable to watch the search progressing dynamically, as if the tree pointed at me and lead to the target.
-
The Strategy:
-
Remove a Node in a BST (Between Medium and Hard Difficulty)
- Given the value of a node, alter a BST to attempt to eliminate a node with that particular value but retain all BST properties.
-
The Strategy:
- Used recursion to locate the node and handled three cases: In the case of trees, a simple deletion of leaf nodes was carried out. Redundant nodes with only one progeny were substituted by this progeny.   The nodes that have two children were replaced with the next node in order which preserved the BST property.
- The Fun Part: Swinging the airship and maintaining the stability of the tree in order did remind me of working on a wonderful painting, one brush stroke at a time.
Features That Made Today Unique
A Grand Finale:
Picking BSTs as the last concept on this journey was ideal since they require accuracy and efficiency, and that is what this data structure is all about.Reflecting on Growth:
I really could not help but feel that today’s problems – including simple array manipulations to very intricate tree walks – had it all: 13 weeks of training right there.The Satisfaction of Mastery:
Getting right these challenges impacted a positive aspect of the result on me and proved that I have been improving.
Key Takeaways
BSTs Are About Balance:
Other problems such as Delete Node in a BST capture the essence of structure use in dealing with complex problems.Precision is Power:
In both the tasks of search and modification, the need to be precise was underscored profoundly to work in a hierarchy that is well thought out.Learning Never Stops:
Although this challenge is over here, the things I discussed in this lecture are going to be my best compass for my coding path.
Reflections
The Search in a Binary Search Tree problem was a pleasant problem that showed how convenient traversal in BST is, and the Delete Node in a BST problem overlaid it with more depth through restructuring. Both of these tasks was apparently a worthy end to a series that has posed as much a challenge as it has been enjoyable.
A Journey Completed
Exactly 13 weeks ago, I embarked on this quest to comprehensively address LeetCode problems with the end goal of evolving as a problem-solver. Over time, I have dwelled in various issues such as arrays, strings, dynamic programming, graph, trees and others. Every week introduced new issues, new experience, and increased understanding of coding as an art.
To be clear, this series has been more than simple solving of issues; it has been a process of learning, strength building and exploration. I find myself solving problems with confidence, appreciate that there is no problem too small to solve, and that problems are multi-faceted.
What’s Next?
Although this 13 week journey is completed today, my journey of coding continues. I look forward to the next steps facing new challenges of problem solving, discovering new algorithms, and telling stories. If there exists one thing that I’ve come to realisation then that is; every answere solved is a way towards mastery and every lesson /difficulty faced is a way towards learning.
To all those readers who have been following this page- thank you for the company. So let’s continue coding, learning, and creating, there’s so much more ahead of in the horizon for us all!
Top comments (0)