## Introduction to Pattern Matching

Given a text, find all occurrences of a given pattern in it.

Read More Introduction to Pattern MatchingCoding made easy

Given a text, find all occurrences of a given pattern in it.

Read More Introduction to Pattern MatchingGiven an array of integers, find out minimum and maximum element present using minimum comparisons.

Read More Find Minimum and Maximum element in an array using minimum comparisonsGiven an array, find peak element in it. A peak element is an element that is greater than its neighbors.

Read More Find the peak element in an arrayGiven a sorted binary array, efficiently find the number of 1’s in it.

Read More Find number of 1’s in a sorted binary arrayGiven 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 …

Read More Search in a nearly sorted array in O(logn) timeGiven 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. More precisely, for a number x, floor(x) is the largest integer less than or equal to x and ceiling(x) is the …

Read More Find Floor and Ceil of a number in a sorted arrayGiven a sorted array of distinct non-negative integers, find smallest missing element in it.

Read More Find smallest missing element from a sorted arrayGiven 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.

Read More Count occurrences of a number in a sorted array with duplicatesGiven a sorted array of integers, find index of first or last occurrence of a given number. If the element is not found in the array, report that as well.

Read More Find first or last occurrence of a given number in a sorted arrayGiven a circular sorted array of integers, search an element in it. Assume there are no duplicates in the array and the rotation is in anti-clockwise direction.

Read More Search an element in a circular sorted arrayGiven a circularly sorted array of integers, find the number of times the array is rotated. Assume there are no duplicates in the array and the rotation is in anti-clockwise direction.

Read More Find number of rotations in a circularly sorted arrayGiven a sorted array of integers and a target value, find out if a target exists in the array or not in O(log(n)) time. If target exists in the array, print index of it.

Read More Exponential searchGiven a sorted array of integers and a target, find out if a target exists in the array or not. If target exists in the array, print index of it.

Read More Interpolation searchGiven a sorted array of integers and a target value, find out if a target exists in the array or not in O(log(n)) time. If target exists in the array, print index of it.

Read More Binary Search