In this post we will discuss few related problems that can be solved without using multiplication and division operators.
Given a binary tree, count all subtrees in it such that every node in the subtree have same value.
Given two integers, find minimum difference between their index in a given array in linear time and single traversal of the array.
Given a BST, find inorder successor of a given key in it. If the given key do not lie in the BST, then return the next greater key (if any) present in the BST.
Given an array, find the maximum absolute difference between sum of elements of two non-overlapping sub-arrays in linear time.
Given a directed weighted graph, report a negative-weight cycle in the graph if any. A negative-weight cycle is a cycle in graph whose edges sum to a negative value.
Given an array of pairs of integers, find all symmetric pairs i.e. pairs that are mirror of each other. For instance, pairs (x, y) and (y, x) are mirrors of each other.
Write a efficient algorithm to construct the longest palindrome by shuffling or deleting characters from a given string.
Given an array of integers, partition the array into two sub-arrays having the same sum of elements.
Given an array and an integer k, find the count of distinct elements in every sub-array of size k in the array.
Given a string and a pattern (having all distinct characters), determine if characters of the string follows specific order as defined by characters of the pattern.
Given an array of integers between 0 to 9, find two numbers with maximum sum formed by using all digits of the array. The difference in number of digits of the two numbers should be ± 1.