Question: Problem 2 Given a binary array (each element is either 0 or 1) of n elements, Give a linear time algorithm to find the maximum

Problem 2 Given a binary array (each element is either 0 or 1) of n elements, Give a linear time algorithm to find the maximum length subarray that has equal number of ls and O's. Use hashing to solve this problem. Problem 3 Given an array of n integers, find the majority element in O(n) time. An element is called majority if the number of occurrences of that element is more than n/2. Use hashing to solve this
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
