# Category Archives: Searching

Given a tree with N nodes and (N-1) edges and source node is at 1st position. There are Q queries, each of the type {pos,â€¦ Read More
Given an array of string arr[] and a string str, the task is to print all the strings in arr[] that occur as a substringâ€¦ Read More
Given a binary tree and an integer X, the task is to find out all the occurrences of X in the given tree, and printâ€¦ Read More
Given two strings A and B, the task is to find the smallest substring of A having B as a subsequence. If there are multipleâ€¦ Read More
Pre-requisite: Binary Search Bitwise Binary Search algorithm is a modified version of Binary Search based on the following idea: Every number can be represented asâ€¦ Read More
The binary search algorithm is used in many coding problems, and it is usually not very obvious at first sight. However, there is certainly anâ€¦ Read More
Given an array arr[] of size N that contains the differences between the adjacents elements of an array. The task is to generate all possibleâ€¦ Read More
Given a vector vec, and integers X and K, the task is to keep replacing X with product of X and K, each time Xâ€¦ Read More
Given an array arr[] denoting the radius of circular pizzas and an integer N denoting the number of friends. The task is to calculate theâ€¦ Read More
Given an array arr[] of N intervals, the task is to calculate the index of the closest interval to the right of each of theâ€¦ Read More
Given two stacks stack1[] and stack2[] of size N and M respectively and an integer K, The task is to count the maximum number ofâ€¦ Read More
Given an array of pairs arr[] of size N where the first value of all the pairs are distinct. For each pair of the givenâ€¦ Read More
Given non-negative integers K, M, and an array arr[] with N elements find the Mth element of the array after K left rotations. Examples: Input:â€¦ Read More
Given non-negative integers K, M, and an array arr[] with N elements find the Mth element of the array after K left rotations. Examples: Input:â€¦ Read More
Given non-negative integers K, M, and an array arr[] with N elements find the Mth element of the array after K left rotations. Examples: Input:â€¦ Read More