Training linear ranking SVMs in linearithmic time using red-black trees