I know there are dynamically sized arrays, but I need a data structure that can remove elements from the middle cheaply. Using pop() with a dynamically sized array should require a shift of every element coming after by one, which would be way too expensive. Is there an industry standard way of doing this?

Alternatively I can switch the element I want to delete with the last element in a dynamic array and then pop() the last element, because the order of my list doesn't matter.