Recursion
Questions based on recursions
Medium
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...
Easy
Implement Currying
Create a function `sum` that implements currying. Currying is a transformation of functions that translates a function from being callable as f(x, y, ...
Easy
Palindrome Check
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...
Easy
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.
Medium
Spiral Traversal
Given a 2D matrix of numbers, return a spiral traversal of the matrix in the clockwise direction.
Medium
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...
Easy
Product Sum
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...
Medium
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...
Easy
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...
Medium
Find Successor
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...
Easy
BST Traversal
Given a Binary Search Tree, Traverse the tree in Preorder, Postorder, and inorder traversal.