Given a sorted array of integers, find floor and ceil of a given number in it. The floor and ceiling map the given number to the largest previous or the smallest following integer, respectively.
Consider a directed graph where weight of its edges can be one of x, 2x or 3x (x is a given integer), compute the least cost path from source to destination efficiently.
Given a sorted array containing duplicates, efficiently find frequency of each element in it without traversing the whole array.
Given an array of integers, find minimum and maximum element present in it by doing minimum comparisons.
Given a text, find all occurrences of a given pattern in it.
Given an array of integers, find out minimum and maximum element present using minimum comparisons.
Given an array, find peak element in it. A peak element is an element that is greater than its neighbors.
Given a sorted binary array, efficiently find the number of 1’s in it.
Given a nearly sorted array such that each of the N elements may be misplaced by no more than one position from the correct sorted order, efficiently search a given element in it. Report if the element is not present in the input array. An element at index i in correct sorted order can …
Given a sorted array of integers, find floor and ceil of a given number in it. The floor and ceil map the given number to the largest previous or the smallest following integer, respectively.
Given a sorted array of distinct non-negative integers, find smallest missing element in it.
Given a sorted array of integers containing duplicates, count occurrences of a number provided. If the element is not found in the array, report that as well.