Queues using binary search tree