阅读背景:

使用随机快速排序查找第k个最小元素,给出逻辑错误

来源:互联网 

So I tried using quicksort for finding the kth smallest element in a vector. But while implementing it my logic is somewhere wrong. And so Im getting wrong answer.I used rand() to generate pivot indexes randomly then shift the pivot index to the right most side of the vector. Check this out:So I tried using quicksort for finding the kth




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: