Questions based on recursions
Create a function `sum` that implements currying. Currying is a transformation of functions that translates a function from being callable as f(x, y, ...
Branch Sums in a Binary Tree
Given a Binary Tree, compute the sum of all the branches in the tree. 1 branch is the path from the root to a leaf.
Given a string of characters, Check if the given string is a palindrome or not. A palindrome is a word, phrase, or sequence that reads the same backwa...
Given a 2D matrix of numbers, return a spiral traversal of the matrix in the clockwise direction.
Invert Binary Tree
Given a binary tree, invert the binary tree - Inverting a binary tree means that the resulting binary tree should be a mirror replica of the input bin...
Given an array (that can have nested arrays) - return the sum of all the numbers in the array. If nested array is encountered, recursively add the num...
Height Balanced Binary Tree
Given a pointer to the root node of a binary tree, return true if the binary tree is height-balanced. A height-balanced binary tree is a Binary tree i...
Binary Tree Diameter
Given a Binary Tree, Return an integer that represents the diameter of the Binary Tree. A Diameter is the length of the longest path in the Binary Tre...
Given the root of a binary tree and a node in it, return the in-order successor of that node in the BST. If the given node has no in-order successor i...
Given a Binary Search Tree, Traverse the tree in Preorder, Postorder, and inorder traversal.
Depth First Search
Depth-first search (DFS) is an algorithm for traversing or searching tree or graph data structures. The algorithm starts at the root node (selecting s...