Lowest Common Ancestor in a BST
Given a Binary Search Tree (with all values unique) and two nodes n1 and n2 (n1 != n2). You may assume that both nodes exist […]
Given a Binary Search Tree (with all values unique) and two nodes n1 and n2 (n1 != n2). You may assume that both nodes exist […]
Given the root of a Binary search tree(BST), where exactly two nodes were swapped by mistake. Your task is to fix (or correct) the
Given a Binary Search Tree(BST) and a target. Check whether there’s a pair of Nodes in the BST with value summing
Given a BST and an integer k, the task is to find the kth smallest element in the BST. If there is no kth
Given a binary tree and an integer k, determine the number of downward-only paths where the sum of the node values in the path equals k.
Given a binary tree, the diameter (also known as the width) is defined as the number of edges on the longest path between two
You are given a two-dimensional mat[][] of size n*m containing English alphabets and a string word. Check if the word exists on the mat. The word
Implement the function power(b, e), which calculates b raised to the power of e (i.e. be). Examples: Input: b = 3.00000, e = 5Output: 243.00000
Given a string s, which may contain duplicate characters, your task is to generate and return an array of all unique permutations of
Given the head of a linked list that may contain a loop. A loop means that the last node of
Given a head of the singly linked list. If a loop is present in the list then return the first node of the loop else return NULL. Custom Input format:A head of a