Week2 deque and elementary sorting