EdocGram
Home
(current)
Topics
EdocAI
Code Editor
HTML
Javascript
PHP
Python
Python AI Code Editor
More
Contact
About
Privacy Policy
Terms and Conditions
Log In
Topic
View
More
Topic
Hashing
Linked List
Queue
Stack
Backtracking
Dynamic Programming
Graph Theory
Bit Manipulation
Mathematics
Sliding Window Technique
Divide And Conquer
Matrix Manipulation
Two Pointers
Tree
Topic: tree-problem / Level: beginner
1. Implement a class for a binary tree and write methods to insert a new node.
2. Write a program to perform in-order traversal of a binary tree.
3. Write a program to perform pre-order traversal of a binary tree.
4. Write a program to perform post-order traversal of a binary tree.
5. Given a binary tree, count the number of nodes.
6. Write a program to find the height of a binary tree.
7. Write a function to find all the leaf nodes in a binary tree.
8. Write a function to check if a binary tree is balanced.
9. Write a program to find the minimum value node in a binary search tree (BST).
10. Write a program to find the maximum value node in a binary search tree (BST).
11. Write a program to search for a value in a binary search tree.
12. Write a function to insert a new value into a binary search tree.
13. Write a function to delete a node from a binary search tree.
14. Implement a function to check if a binary tree is a full binary tree.
15. Write a program to count the number of leaf nodes in a binary tree.
16. Implement a function to find the diameter of a binary tree.
17. Write a program to find the sum of all the values in a binary tree.
18. Implement a function to find the deepest node in a binary tree.
19. Write a program to check if a binary tree is a complete binary tree.
20. Write a function to print all ancestors of a given node in a binary tree.
21. Write a program to find the level of a given node in a binary tree.
22. Implement a function to check if a binary tree is a binary search tree.
23. Write a program to find the kth smallest element in a binary search tree.
24. Implement a function to find the kth largest element in a binary search tree.
25. Write a program to find the lowest common ancestor of two nodes in a binary tree.
26. Implement a function to serialize and deserialize a binary tree.
27. Write a program to convert a binary tree to its mirror image.
28. Write a function to determine the maximum path sum in a binary tree.
29. Implement a program to find all root-to-leaf paths in a binary tree.
30. Write a program to find the number of nodes at the deepest level of a binary tree.
31. Implement a function to print the nodes at a given level in a binary tree.
32. Write a program to find the sibling of a given node in a binary tree.
33. Write a program to print all the leaf nodes of a binary tree.
34. Implement a function to find the in-order predecessor of a given node in a binary search tree.
35. Write a program to find the in-order successor of a given node in a binary search tree.
36. Implement a function to check if two binary trees are identical.
37. Write a program to find all the paths from root to leaves in a binary tree.
38. Implement a function to level order traversal using recursion.
39. Write a program to find the second largest element in a binary search tree.
40. Implement a function to count the number of internal nodes in a binary tree.
41. Write a program to find the smallest value in a binary tree.
42. Implement a function to reverse level order traversal of a binary tree.
43. Write a program to find all nodes at distance k from a given node in a binary tree.
44. Implement a function to count nodes with only one child in a binary tree.
45. Write a program to check if a binary tree is symmetric.
46. Implement a function to find the path with the maximum sum in a binary tree.
47. Write a program to find the longest path in a binary tree.
48. Implement a function to find the number of nodes at a specific depth in a binary tree.
49. Write a program to print the boundary of a binary tree.
50. Implement a function to check if a binary tree is a subtree of another binary tree.
Previous
1
2
...
20
Next
More Levels
Intermediate
Advanced
Aniket The Programmer
This website is managed by aniket the programmer :)
Website
Instagram