Skip to content

Bubble sort updated to efficient version - #50

Merged
AnupKumarPanwar merged 2 commits into
TheAlgorithms:masterfrom
CaseyLaClair:BubbleSort
May 19, 2017
Merged

AnupKumarPanwar merged 2 commits into
TheAlgorithms:masterfrom
CaseyLaClair:BubbleSort

Conversation

@CaseyLaClair

Copy link
Copy Markdown
Contributor

Updated to a more efficient version of bubble sort by adding decrements after loop and changing loop type.

Changed loop from "for" to "do-while". Added decrement at end of do loop to decrease size of array tested after each iteration.
Updated to more efficient version if array size is scaled.
@AnupKumarPanwar
AnupKumarPanwar merged commit 4e14531 into TheAlgorithms:master May 19, 2017
@CaseyLaClair
CaseyLaClair deleted the BubbleSort branch May 20, 2017 00:43
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