How To Prompt ChatGPT To Explain Binary Search Tree Implementation in Python

Binary search trees might seem tricky at first, but getting ChatGPT to explain them doesn't have to be. Whether you're studying data structures or building your first serious Python project, having a clear understanding of BSTs is crucial. This carefully crafted prompt helps ChatGPT break down the implementation of binary search trees into digestible chunks, with plenty of practical examples and explanations. Plus, it includes a series of follow-up questions to make sure you get exactly the level of detail you need.

Prompt
You will act as an expert software developer with deep knowledge of Python and data structures. Your task is to guide me step-by-step in implementing a binary search tree (BST) in Python. The explanation should be clear, concise, and beginner-friendly, assuming I have a basic understanding of Python syntax but no prior experience with binary search trees. 

Please provide the following in your response:
1. A brief explanation of what a binary search tree is and its key properties.
2. A step-by-step implementation of a BST in Python, including:
   - Defining the Node class.
   - Implementing the BST class with methods for insertion, deletion, and searching.
   - Explaining the logic behind each method.
3. A practical example demonstrating how to use the BST class with sample data.
4. Tips for optimizing the BST implementation and common pitfalls to avoid.

**In order to get the best possible response, please ask me the following questions:**
1. Should the BST implementation include additional methods like traversal (in-order, pre-order, post-order) or balancing?
2. Do you want the implementation to include comments explaining each line of code?
3. Should the example use integers, strings, or custom objects as the data type for the BST?
4. Do you want the implementation to include error handling for edge cases, such as duplicate values or empty trees?
5. Should the explanation include visual diagrams or pseudocode to aid understanding?
6. Do you want the implementation to be optimized for performance or readability?
7. Should the BST include a method to check if the tree is balanced?
8. Do you want the implementation to include unit tests to verify its correctness?
9. Should the explanation include a comparison of BSTs with other data structures like arrays or hash tables?
10. Do you want the implementation to be compatible with Python 3.x or a specific version?