Given an array of n element and an element x in the array, is there a fast way to find the rank of x, without sorting it?
As I'm now dealing with a very large array, an algorithm with O(n) time complexity would still be too slow for me to work with which is why I am trying to find other alternative other than sorting.
EDIT:
So right now my algorithm is something like:
for x in list:
A = x.dot(B) ## return a numpy array
rank = findRank(a, A) ## find the rank of a in A
doSomething2(rank)
So here my bottleneck is findRank(), in my current implementation, I first sort the array and then find the rank of the element in the sorted array.