What is the time complexity of this algorithm?
while len(array) > 0:
for item in array:
do stuff to determine which item to pop
array.pop(item_to_pop)
My first instinct is O(N^2). However, if I were to reduce the array size by half each time the while condition executed it would be O(n). I'm guessing reducing my array size by 1 each iteration does not have the same effect?