We have an unordered sequence $A$ which consists of $n$ different numbers $A[1],A[2],A[3],\dots, A[n]$.
One member of $A$ is named an approximate median if $A$ contains at least $n/4$ members smaller than $x$ and at least $n/4$ members bigger than $x$.
How to design a deterministic algorithm than finds all approximate medians in time $O(n)$?