Hello everybody,
Can someone, please, explain to me a small quicksort implementation detail in the UndirectedGraph class.
In the method selectPivotIndex there is an early return block
if (startIndex - endIndex <= 1)
return startIndex;
It seems that this condition is always true. That's totally fine for the quicksort implementation as the pivot could be any element in between startIndex and endIndex, though the heuristic after this block would be obsolete. Is it correct?