algorithm - Is Quicksort "adaptive" and "online"? -


that say, quicksort perform better when given sorted list? don't see why case, perhaps don't understand algorithm.

also, can quicksort "keep going" whilst add new data list while sorting? seems me algorithm needs full set of data @ beginning "work".

does quicksort perform better when given sorted list?

no, in fact way it's taught (use first element pivot) sorted (or sorted) list worst-case. using middle or random element pivot can mitigate this, however.

can quicksort "keep going" whilst add new data list while sorting?

no, intuition correct, need entire data set start.


Comments

Popular posts from this blog

python - Operations inside variables -

Generic Map Parameter java -

arrays - What causes a java.lang.ArrayIndexOutOfBoundsException and how do I prevent it? -