Given an array , each element is one more or one less than its preceding element . We need to search for a particular element in it . What is the most optimal solution ?
Given an array of n elements , what is a linear-time algorithm that finds all elements that appear more than n/3 times ?