## Find the element that appears once in a sorted array

Given a sorted array in which all elements appear twice (one after one) and one element appears only once. Find that element in O(log n)… Read More »

- Maximum element in a sorted and rotated array
- Count the triplets such that A[i] < B[j] < C[k]
- Interactive Problems in Competitive Programming
- Complexity Analysis of Binary Search
- Minimum steps to delete a string by deleting substring comprising of same characters
- Lazy Propagation in Segment Tree | Set 2
- Maximum Sum SubArray using Divide and Conquer | Set 2
- Find minimum steps required to reach the end of a matrix | Set - 1
- Sum of maximum of all subarrays | Divide and Conquer
- Kth smallest element in the array using constant space when array can't be modified
- Find minimum steps required to reach the end of a matrix | Set 2
- IntroSort or Introspective sort
- Largest number N which can be reduced to 0 in K steps
- Find 2^(2^A) % B
- Cost Based Tower of Hanoi
- Find the number of different numbers in the array after applying the given operation q times
- Find the value of XXXX.....(N times) % M where N is large
- Modular Exponentiation of Complex Numbers
- Cartesian tree from inorder traversal | Segment Tree
- Sum of i * countDigits(i)^2 for all i in range [L, R]

Given a sorted array in which all elements appear twice (one after one) and one element appears only once. Find that element in O(log n)… Read More »

1. Machine Coding: Two players, two field; and have multiple ships located in their fields. They are guessing each others ship position and hitting. Tell… Read More »

Tower of Hanoi is a mathematical puzzle. It consists of three poles and a number of disks of different sizes which can slide onto any… Read More »

Given n rectangular buildings in a 2-dimensional city, computes the skyline of these buildings, eliminating hidden lines. The main task is to view buildings from… Read More »

Given a n by n board where n is of form 2k where k >= 1 (Basically n is a power of 2 with minimum… Read More »

Given an array that represents elements of arithmetic progression in order. One element is missing in the progression, find the missing number. Examples: Input: arr[]… Read More »

Given two polynomials represented by two arrays, write a function that multiplies given two polynomials. Example: Input: A[] = {5, 0, 10, 6} B[] =… Read More »

Given a directed graph and two vertices ‘u’ and ‘v’ in it, count all possible walks from ‘u’ to ‘v’ with exactly k edges on… Read More »

Tower of Hanoi is a mathematical puzzle where we have three rods and n disks. The objective of the puzzle is to move the entire… Read More »

Given an n x n matrix, where every row and column is sorted in increasing order. Given a key, how to decide whether this key… Read More »

Given an array of 1s and 0s which has all 1s first followed by all 0s. Find the number of 0s. Count the number of… Read More »

Given two square matrices A and B of size n x n each, find their multiplication matrix. Naive Method Following is a simple way to… Read More »

Given a sorted array arr[] of n elements, write a function to search a given element x in arr[]. A simple approach is to do… Read More »

Like Merge Sort, QuickSort is a Divide and Conquer algorithm. It picks an element as pivot and partitions the given array around the picked pivot.… Read More »

We are given an array of n points in the plane, and the problem is to find out the closest pair of points in the… Read More »