Skip to content

# Category Archives: Searching

Given an array arr[] consisting of N positive integers, the task is to find the elements which are greater than at least half of the… Read More
Given an array arr[] of size N and an integer K, the task is to count the number of negative elements present in all K-length… Read More
Given two integers W and C, representing the number of watermelons and coins, the task is to find the maximum number of mangoes that can… Read More
Given an array A[] of size N and an integer X, the task is to check if X exists in A[] with no more than… Read More
Given two arrays arr1[] and arr2[] consisting of N and M integers respectively, the task is to find the probability of randomly selecting the two… Read More
Given a 2D array arr[][] of size N*M consisting of ‘.’ and ‘*’ characters representing a floor and two positive integers A and B representing… Read More
Given a sorted array arr[] of size N and an integer K, the task is to find Kth smallest element present in the array. The… Read More
Given a sorted array arr[] of size N and an integer key, the task is to find the index at which key is present in… Read More
Given a string path consisting of characters ‘N’, ‘S’, ‘E’ and ‘W’ denoting 1 unit movement in North, South, East, and West directions respectively, the… Read More
Given an array, arr[] of size N denoting a permutation of numbers from 1 to N, the task is to count the number of inversions… Read More
Given two positive integers A and B representing Bitwise XOR and Bitwise OR of two positive integers, the task is to find all possible pairs… Read More
Given two integers L and R and an array arr[] consisting of N positive integers( 1-based indexing ) such that the frequency of ith element… Read More
Boolean Model:  It is a simple retrieval model based on set theory and boolean algebra. Queries are designed as boolean expressions which have precise semantics.… Read More
Given a string S of size N consisting of characters a, b, and c only, the task is to find the number of substrings of… Read More
Given a string S of size N consisting of unique ID and Domain Name of a unique website, the task is to find the ID… Read More