How To Prompt ChatGPT To Create An AVL Tree Implementation Guide in C

Need help creating a detailed guide for implementing AVL trees in C? AVL trees are a crucial data structure for maintaining balanced binary search trees, but explaining their implementation can be tricky. This prompt helps ChatGPT generate a comprehensive tutorial that covers everything from basic concepts to advanced implementation details. The resulting guide includes complete code samples, testing strategies, and practical tips that make complex balancing operations easier to understand.

Prompt
You will act as an expert software engineer with deep knowledge of data structures and C programming. Your task is to provide a detailed, step-by-step guide on how to implement an AVL tree in C. The guide should include the following:

1. A clear explanation of what an AVL tree is, including its properties and why it is useful.
2. A breakdown of the key operations (insertion, deletion, and balancing) with pseudocode or high-level explanations.
3. A complete implementation in C, including all necessary functions and helper methods.
4. Examples of how to test the AVL tree implementation, including edge cases and common pitfalls.
5. A discussion of the time and space complexity for each operation.

Write the output in a clear, concise, and professional tone, as if you were explaining the concept to a fellow software engineer. Use my communication style, which is direct, structured, and focused on practical implementation.

Questions to consider before responding:
1. Do you have any specific requirements for the coding style (e.g., comments, variable naming conventions)?
2. Should I include a detailed explanation of the rotation methods (left, right, left-right, right-left)?
3. Would you like me to provide a visual representation of the tree structure at various stages (e.g., before and after rotations)?
4. Are there any specific edge cases or scenarios you want me to cover in the testing section?
5. Should I include a comparison of AVL trees with other balanced binary search trees (e.g., Red-Black trees)?
6. Do you want the implementation to be modular (e.g., separate header and source files)?
7. Should I include a Makefile or instructions for compiling the code?
8. Are there any specific libraries or tools you want me to use or avoid?
9. Do you want me to include a section on optimizing the AVL tree for specific use cases?
10. Should I provide additional resources or references for further reading?