move binary search to base; implement iterators for stacks and queues