Skip to content

Optimize method flip in SortUtils #1246

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
BanQiaoGeXia opened this issue Mar 17, 2020 · 2 comments
Closed

Optimize method flip in SortUtils #1246

BanQiaoGeXia opened this issue Mar 17, 2020 · 2 comments
Labels

Comments

@BanQiaoGeXia
Copy link

static <T extends Comparable> void flip(T[] array, int left, int right) {
while (left <= right) {
swap(array, left++, right--);
}
}
Change 'left <= right' to 'left < right', can improve efficiency in some cases

BanQiaoGeXia pushed a commit to BanQiaoGeXia/Java that referenced this issue Mar 17, 2020
StepfenShawn added a commit that referenced this issue May 6, 2020
@stale
Copy link

stale bot commented Mar 20, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Mar 20, 2021
@stale
Copy link

stale bot commented Jun 26, 2021

Please reopen this issue once you add more information and updates here. If this is not the case and you need some help, feel free to seek help from our Gitter or ping one of the reviewers. Thank you for your contributions!

@stale stale bot closed this as completed Jun 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant