## Babylonian method for square root

Algorithm: This method can be derived from (but predates) Newton–Raphson method. 1 Start with an arbitrary positive start value x (the closer to the root,… Read More »

- Live Classes for Data Structures and Algorithms: Interview Preparation Focused Course
- Count of triplets that satisfy the given equation
- Maximum Sequence Length | Collatz Conjecture
- Implementation of BFS using adjacency matrix
- Find a pair (n,r) in an integer array such that value of nPr is maximum
- Minimum increment or decrement operations required to make the array sorted
- Maximum XOR of Two Numbers in an Array
- Check if the rows of a binary matrix can be made unique by removing a single column
- Longest Increasing Subsequence using Longest Common Subsequence Algorithm
- Color all boxes in line such that every M consecutive boxes are unique
- Count the number of elements which are greater than any of element on right side of an array
- Count all substrings having character K
- Count of triples (A, B, C) where A*C is greater than B*B
- Minimum increment operations to make K elements equal
- Maximise the number of toys that can be purchased with amount K using min Heap
- Number of sub arrays with negative product
- Minimize the cost of partitioning an array into K groups
- Find a pair (n,r) in an integer array such that value of nCr is maximum
- Minimum distance to visit all the nodes of an undirected weighted tree
- Widest Path Problem | Practical application of Dijkstra's Algorithm
- Count the values greater than X in the modified array
- Maximize the Expression | Bit Manipulation
- Maximum non-attacking Knights that can be placed on an N*M Chessboard
- Sum of absolute differences of pairs from the given array that satisfy the given condition
- Expand the string according to the given conditions
- Comparing X^Y and Y^X for very large values of X and Y
- Implementation of DFS using adjacency matrix
- Find all numbers between range L to R such that sum of digit and sum of square of digit is prime
- Blowfish Algorithm with Examples
- Minimum number of additons to make the string balanced

Algorithm: This method can be derived from (but predates) Newton–Raphson method. 1 Start with an arbitrary positive start value x (the closer to the root,… Read More »

Given an array of positive numbers, find the maximum sum of a subsequence with the constraint that no 2 numbers in the sequence should be… Read More »

Compute n modulo d without division(/) and modulo(%) operators, where d is a power of 2 number. Let ith bit from right is set in… Read More »

Write a function rotate(ar[], d, n) that rotates arr[] of size n by d elements. Rotation of the above array by 2 will make array… Read More »

On some rare machines where branching is expensive, the below obvious approach to find minimum can be slow as it uses branching. filter_none edit close… Read More »

Bit Rotation: A rotation (or circular shift) is an operation similar to shift except that the bits that fall off at one end are put… Read More »

Asked by SG Given an array in which all numbers except two are repeated once. (i.e. we have 2n+2 numbers and n numbers are occurring… Read More »

There are 2 sorted arrays A and B of size n each. Write an algorithm to find the median of the array obtained after merging… Read More »

Given two numbers ‘a’ and b’. Write a program to count number of bits needed to be flipped to convert ‘a’ to ‘b’. Example :… Read More »

Write an efficient program to count number of 1s in binary representation of an integer. Examples : Input : n = 6 Output : 2… Read More »

An element in a sorted array can be found in O(log n) time via binary search. But suppose we rotate an ascending order sorted array… Read More »

Asked by Anshya. Below are the different ways to add base 14 numbers. Method 1 Thanks to Raj for suggesting this method. 1. Convert both… Read More »

Lucky numbers are subset of integers. Rather than going into much theory, let us see the process of arriving at lucky numbers, Take the set… Read More »

Given an unsigned integer, reverse all bits of it and return the number with reversed bits. Input : n = 1 Output : 2147483648 On… Read More »

A permutation, also called an “arrangement number” or “order,” is a rearrangement of the elements of an ordered list S into a one-to-one correspondence with… Read More »