python collections deque time complexity