Division of two numbers using binary search algorithm
This post will discuss the division of two numbers (integer or decimal) using the binary search algorithm.
Ace your Coding Interview
Get hired by top tech companies with our comprehensive interview preparation.
Get StartedThis post will discuss the division of two numbers (integer or decimal) using the binary search algorithm.
Given an integer array, find subarrays with a given sum in it.
Given an M × N binary matrix, fill it with alternating rectangles of 0 and 1.
Given a binary tree, write an iterative algorithm to print the leaf-to-root path for every leaf node. Use of recursion is prohibited.
Given a directed acyclic graph (DAG) and a source vertex, find the shortest path’s cost from the source vertex to all other vertices present in the graph. If the vertex can’t be reached from the given source vertex, print its distance as infinity.
Consider a directed graph where the 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 square matrix, print the maximum length snake sequence in it. A snake sequence is defined as a sequence of numbers where each new number, which can only be located to the right or down of the current number, is either plus or minus one.
Given a set S of positive integers, determine if it can be partitioned into three disjoint subsets that all have the same sum, and they cover S.
This post will sort an integer array using the iterative merge sort algorithm. Merge sort is an efficient sorting algorithm that falls under the Divide and Conquer paradigm and produces a stable sort.
Given an integer array, duplicates appear in it an even number of times except for two elements, which appear an odd number of times. Find both odd appearing elements without using any extra memory.
Given a binary tree, write a recursive algorithm to print all paths from leaf to root node.
Given a positive integer n, find all n–digit binary numbers having more 1’s than 0’s for any prefix of the number.