Skip to content

QuickSort implementation on undirected graph #14

@st235

Description

@st235

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions