Skip to content

Break if the collection is sorted#321

Merged
harshildarji merged 1 commit intoTheAlgorithms:masterfrom
aldokkani:master
Jun 25, 2018
Merged

Break if the collection is sorted#321
harshildarji merged 1 commit intoTheAlgorithms:masterfrom
aldokkani:master

Conversation

@aldokkani
Copy link
Copy Markdown

The current implementation efficiency is O(n^2) always.
Now it allow for better performance, for example when the collection is already sorted or slightly disordered. It can achieve Best case performance O(n).

@harshildarji harshildarji merged commit d4b4b7b into TheAlgorithms:master Jun 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants