-
Level Order Traversal Problem.
Question
Solution
Command:-$ go run 1.level-order-traversal-solution.go < 0.input-file.txt
Method TimeComplexity SpaceComplexity Source Using Queue O(N) O(N) Link -
Level Order Build Tree Problem.
Question
Solution
Command:-$ go run 2.level-order-build-tree-solution.go < 0.input-file.txt
Method TimeComplexity SpaceComplexity Source Using Queue O(N) O(N) Link -
Recursive Pre Order Traversal Problem.
Question
Solution
Command:-$ go run 3.preorder-traversal-recursive-solution.go < 0.input-file.txt
Method TimeComplexity SpaceComplexity Source Recursive O(N) O(N) Link -
Iterative Pre Order Traversal Problem.
Question
Solution
Command:-$ go run 4.preorder-traversal-iterative-solution.go < 0.input-file.txt
Method TimeComplexity SpaceComplexity Source Iterative using stack O(N) O(N) Link -
Recursive In Order Traversal Problem.
Question
Solution
Command:-$ go run 5.inorder-traversal-recursive-solution.go < 0.input-file.txt
Method TimeComplexity SpaceComplexity Source Recursive O(N) O(N) Link -
Iterative In Order Traversal Problem.
Question
Solution
Command:-$ go run 6.inorder-traversal-iterative-solution.go < 0.input-file.txt
Method TimeComplexity SpaceComplexity Source Iterative using stack O(N) O(N) Link -
Recursive Post Order Traversal Problem.
Question
Solution
Command:-$ go run 7.postorder-traversal-recursive-solution.go < 0.input-file.txt
Method TimeComplexity SpaceComplexity Source Recursive O(N) O(N) Link -
Recursive Post Order Traversal Problem.
Question
Solution
Command:-$ go run 8.postorder-traversal-iterative-solution.go < 0.input-file.txt
Method TimeComplexity SpaceComplexity Source Iterative using stack O(N) O(N) Link -
Height of Binary Tree Problem.
Question
Solution
Command:-$ go run 9.height-of-tree-solution.go < 0.input-file.txt
Method TimeComplexity SpaceComplexity Source Recursive O(N) O(N) Link -
Diameter of Binary Tree Problem.
Question
Solution O(N^2)
Solution O(N)
Command:-$ go run 10.diameter-of-tree-o(n^2)-solution.go < 0.input-file.txt $ go run 10.diameter-of-tree-o(n)-solution.go < 0.input-file.txt
Method TimeComplexity SpaceComplexity Source Calculating height and diameter in different call O(N^2) O(N) Link Calculating height and diameter in same call O(N) O(N) Link -
Replace Descendants Sum Tree Problem.
Question
Solution
Command:-$ go run 11.replace-with-descendants-sum-solution.go
Method TimeComplexity SpaceComplexity Source Recursive O(N) O(N) Link -
Height Balanced Tree Problem.
Question
Solution O(N^2)
Solution O(N)
Command:-$ go run 12.is-balanced-tree-o(n^2)-solution.go < 0.input-file.txt $ go run 12.is-balanced-tree-o(n)-solution.go < 0.input-file.txt
Method TimeComplexity SpaceComplexity Source Calculating height and balance check in different call O(N^2) O(1) Link Calculating height and balance check in same call O(N) O(1) Link -
Max Sub Set Sum Tree Problem.
Question
Solution
Command:-$ go run 13.max-sub-set-sum-solution.go < 0.input-file.txt
Method TimeComplexity SpaceComplexity Source Recursive O(N) O(1) Link -
Nodes At Distance k from target Node (Sorted) Problem.
Question
Solution
Command:-$ go run 14.nodes-at-kth-distance-from-target-node-solution.go
Method TimeComplexity SpaceComplexity Source Recursive O(N) O(1) Link
10. Binary Tree
Folders and files
Name | Name | Last commit date | ||
---|---|---|---|---|
parent directory.. | ||||