Given an array, if all the elements are distinct, can we find the count of elements which are lesser than an element and present to the left of that element in linear time if we have to do it for every element.I know this can be solved in O(nlogn) time by using self balancing trees, but I want to know whether we can solve it in O(N)?
Linear time algorithm for array with distinct element
algorithms;arrays