RectangleBinPack icon indicating copy to clipboard operation
RectangleBinPack copied to clipboard

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

Open jube opened this issue 2 years ago • 0 comments

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!

jube avatar Sep 11 '23 21:09 jube