Medium

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...

1 like

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 a 2D matrix of numbers, return a spiral traversal of the matrix in the clockwise direction.

Easy

Given two arrays of integers, find the pair of values (one value in each array) with the smallest (non-negative) difference.

Given a Binary Search Tree, Traverse the tree in Preorder, Postorder, and inorder traversal.

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...

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 of integers A sorted in non-decreasing order, return an array of the squares of each number, also in sorted non-decreasing order.

Given an integer n, return the nth Fibonacci number. In mathematics, the Fibonacci numbers form a sequence called the Fibonacci sequence - In which ea...

2 likes

Given a string of alphabets (from a to z), Print the count of the character appearing in the string right next to it. This is also called Run Length E...

Given an array of integers and a target value, move all instances of that target value to the end end of the array. The order of the resulting array d...

Given a sorted linked list, delete all duplicates such that each element appear only once.

Find Kth largest in a BST - Given a BST and a number k, find the kth largest element in the BST.

Given a string of characters, return the index of the first non-repeating character.

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 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...

Given an array of integers, find three integers in the array that sum to a specific target number.

Construct a Binary Search Tree and implement that implements insert, search, traverse and delete methods.

5 likes

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.

3 likes

Given an array of sorted integers in ascending order, and a target integer, write a function to search target in nums array. If target exists, return ...

A monotonic array is an array whose elements, from left to right, are entirely non-increasing, or entirely non-decreasing. Return true if the given ar...