Skip to content
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

GuillotineBinPack::MergeFreeList is not theta(n^2) #33

Open
jube opened this issue Sep 11, 2023 · 0 comments
Open

GuillotineBinPack::MergeFreeList is not theta(n^2) #33

jube opened this issue Sep 11, 2023 · 0 comments

Comments

@jube
Copy link

jube commented Sep 11, 2023

Calling erase which is O(n) in the middle of the loop makes the algorithm worse than theta(n^2). erase could be replaced with a swap between the erased element and the last element, and a pop_back (both are O(1)).

Great project, great article. I will use the Guillotine algorithm(s) in my project!

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

No branches or pull requests

1 participant