C# Recursive function design collections from 2019 to 2020
May 27, 2020
It is most challenging task to build good learning material for software engineers. How to design recursive function to solve lowest common ancestor? I like to put together a collection of solutions with the following list of recursive function return:
- Return bool
- Return void
- Return TreeNode
- Return Stack
- Return Tuple<TreeNode, int>
- Good ones vs bad ones - mix returns - break single-responsibility principle SRP
- More will be added later
Recursive function is fun to play
how to build a path from p or q to root (May 11, 2019)
how to build a path from root to p (May 23, 2019)
Find the path H for node p, and find path for node q and also check hashset for path H, June 14, 2019 mock interview case study Clever idea!
how to build a path from root to p (May 23, 2019)
Find the path H for node p, and find path for node q and also check hashset for path H, June 14, 2019 mock interview case study Clever idea!
Recursive function design, why mix return will lead to lowest common ancestor?
recursive function - Confused and more work later (May 8, 2019)
recursive function - mix returns, final one is lowest common ancestor (May 29, 2019)
C# post order traversal and return p or q in recursive function case study mock interview on June 18, 2019
recursive function - Confused and more work later (May 8, 2019)
recursive function - mix returns, final one is lowest common ancestor (May 29, 2019)
C# post order traversal and return p or q in recursive function case study mock interview on June 18, 2019
Return type
Return bool or TreeNode?
Recursive solution Easy to understand - return bool (May 15, 2019)
Recursive solution Easy to understand - return TreeNode (May 29, 2019)
Return bool or TreeNode?
Recursive solution Easy to understand - return bool (May 15, 2019)
Recursive solution Easy to understand - return TreeNode (May 29, 2019)
Return Tuple<TreeNode, int> or ArrayList? Always strong typing
C# Postorder traversal and count nodes found practice in 2020 Learn from ex-facebook engineer, super performance, April 30, 2020
C# Postorder traversal and count nodes found practice in 2020 Learn from ex-facebook engineer, super performance, April 30, 2020
May 25, 2020
C# Tuple<TreeNode, int> design talk and second practice on May 25 2020
C# Tuple<TreeNode, int> design talk and quick practice in May 25 2020
C# Tuple<TreeNode, int> design talk and second practice on May 25 2020
C# Tuple<TreeNode, int> design talk and quick practice in May 25 2020
Using Stack data structure
Recursive function using Stack return Stack (June 10, 2019)
Recursive function using Stack return bool (June 10, 2019)
Recursive function using Stack return Stack (June 10, 2019)
Recursive function using Stack return bool (June 10, 2019)
My advice
Please kindly consider carefully to choose good recursive function to solve the problem in mock interview or onsite interview. Most of important is to focus on quality, not quantity to solve Leetcode algorithms.
Good one to showcase talent
Return Tuple<TreeNode, int> or ArrayList? Always strong typing
C# Postorder traversal and count nodes found practice in 2020 Learn from ex-facebook engineer, super performance, April 30, 2020
Return Tuple<TreeNode, int> or ArrayList? Always strong typing
C# Postorder traversal and count nodes found practice in 2020 Learn from ex-facebook engineer, super performance, April 30, 2020
Not so good one, memorize a solution - Need hardwork in practice
recursive function - mix returns, final one is lowest common ancestor (May 29, 2019)
recursive function - mix returns, final one is lowest common ancestor (May 29, 2019)
recursive function designsrp principlec# strong type tuple
No comments:
Post a Comment