Day 42 of #SDESheetChallenge@takeUforward_@striver_79
1) Floor & Ceil: same logic as successor and predecssor 2) Kth Smallest & Largest: applied inorder traversal on the tree storing vals in a vector and applied indexing
Day 42 of #SDESheetChallenge@takeUforward_@striver_79
1) Floor & Ceil: same logic as successor and predecssor
2) Kth Smallest & Largest: applied inorder traversal on the tree storing vals in a vector and applied indexing
Day 41 of #SDESheetChallenge by @takeUforward_@striver_79
1) BST frm Preorder & Validate BST: Used upper and lower bound logic recursively.
3) Inorder successor and predecessor: used pointers to track both.
4) LCA in BST: traversed by comparing root with p and q.
Day 41 of #SDESheetChallenge by @takeUforward_@striver_79
1) BST frm Preorder & Validate BST: Used upper and lower bound logic recursively.
3) Inorder successor and predecessor: used pointers to track both.
4) LCA in BST: traversed by comparing root with p and q.
Day 40 of #SDESheetChallenge by @takeUforward_@striver_79
1) Populating nxt pointers: using parent's next to connect right child is the trick
2) Search in BST: pretty ez and intuitive
3) Sorted arr to BST: got hella confused with this one until I found out the bs approach
Day 40 of #SDESheetChallenge by @takeUforward_@striver_79
1) Populating nxt pointers: using parent's next to connect right child is the trick
2) Search in BST: pretty ez and intuitive
3) Sorted arr to BST: got hella confused with this one until I found out the bs approach
@shaqxdev Maybe the task board can have a bit more padding around the text but everything else looks nice...
The idea itself is pretty unique so kuddos for that as well
Day 36 of #SDESheetChallenge by @takeUforward_@striver_79
1) Level Order: Used a queue to record each level and store in vector
2) Max Depth: Used the same logic as lvl order to realize no. of lvls
3) Diameter of BT: req. assistance for the recursive function logic