- Given a binary tree and a sum, return true if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum. - hasPathSum
- Write a program to verify whether the given tree is a binary search tree.( with and without using recursion) - isBST
- Check if all the leaves are at the same level in a binary tree - sameLevel
- Given a tree, find the path that sums up to a given number. - pathSum2
- Using a tree, find the first common ancestor of two nodes
- Print out the parent and children given a particular depth in a given tree.
- Determine if a tree is balanced. - isBalanced
- How to check whether a binary tree is identical to another binary tree? What is the time complexity? - sameTree
- Serialization and deserialization of a tree to a string. If every node of tree represents a letter serialize tree to string in a way that you can deserialize the same string to a tree again.
- Nearest ancestor node of binary tree.
- Given the inorder traversal of a n-ary tree where every node can have either n or 0 children, and is marked "p" if that node has n children, or marked "q" if that node has 0 children, try reconstruct that tree.
- Convert each level of Binary tree into a linked list - levelOrderTraversal
- Given a binary tree(not necessarily BST), return the sum of all kth level nodes. What is the complexity?
- Level order traversal of a binary tree - levelOrderTraversal
- Write a function to find the total number of leaf nodes in a binary tree. countTheLeaves
- Given a binary tree, find its maximum depth. maximum-depth-of-binary-tree
- Invert Binary Tree invert-binary-tree
- Given two non-empty binary trees s and t, check whether tree t has exactly the same structure and node values with a subtree of s subtree-of-another-tree
Questions 8, 16, 17 are part of Team Blind's curated list
- You are given a list of projects and a list of dependencies. All of a project's dependencies must be built before the project is. Find a build order that will allow the projects to be built. If there is no valid build order return an error. - projectDependencies
- Given a 2d grid map of '1's (land) and '0's (water), count the number of islands. An island is surrounded by water and is formed by connecting adjacent lands horizontally or vertically. You may assume all four edges of the grid are all surrounded by water. - numberOfIslands