Whenever you're ready, walk me through how you'd approach this.
How would you implement a queue and a stack using BST-related logic? Explain how keys or ordering would provide FIFO and LIFO behavior, how duplicate insertion priorities are handled, and how removal works. Discuss the time and space complexity for balanced and unbalanced trees, plus why a BST would or would not be preferable to a linked list, array, or deque.