Find the largest subarray having an equal number of 0’s and 1’s
Given a binary array containing 0 and 1, find a maximum length subarray with equal numbers of 0’s and 1’s.
Ace your Coding Interview
Get hired by top tech companies with our comprehensive interview preparation.
Get StartedGiven a binary array containing 0 and 1, find a maximum length subarray with equal numbers of 0’s and 1’s.
Given an integer array, find the maximum length subarray having a given sum.
Given an array of integers, check if the array contains a sub-arrays with 0-sum. Also, prints end-points of all such sub-arrays…
Given an integer array containing duplicates, return the majority element if present. A majority element appears more than n/2 times, where n is the array size.
Given an unsorted integer array, find a pair with the given sum in it.
Given a binary tree, calculate the sum of all nodes for each diagonal having negative slope (\). Assume that the left and right child of a node makes a 45–degree angle with the parent.
Given a binary tree, print all nodes for each diagonal having negative slope (\). Assume that the left and right child of a node makes a 45–degree angle with the parent.
Given a binary tree, perform vertical traversal on it. In vertical traversal, nodes of a binary tree are printed in vertical order. Assume that the left and right child makes a 45–degree angle with the parent.
Given a binary tree, the print vertical sum of it. Assume the left and right child of a node makes a 45–degree angle with the parent.
Given a binary tree, find all ancestors of a given node in it.
Given a binary tree, print the top view of it. Assume the left and right child of a node makes a 45–degree angle with the parent.
Given a binary tree, print the bottom view of it. Assume the left and right child of a node makes a 45–degree angle with the parent.