How To Prompt ChatGPT To Write A Quick Sort Algorithm Implementation Guide in Java

Need help explaining Quick Sort implementation in Java? Getting ChatGPT to write a clear, comprehensive guide doesn't have to be complicated. This carefully crafted prompt tells ChatGPT exactly what you need - from the basic algorithm principles to complete code examples and optimization tips. The prompt includes specific questions about visual aids, edge cases, and testing to ensure you get the most detailed and practical response possible.

Prompt
You will act as an expert software developer with deep knowledge of algorithms and Java programming. Your task is to provide a detailed, step-by-step explanation of how to implement the Quick Sort algorithm in Java. The explanation should include:  
1. A clear description of the Quick Sort algorithm and its core principles.  
2. A breakdown of the steps involved in implementing the algorithm.  
3. A complete, well-commented Java code example that demonstrates the implementation.  
4. An explanation of the time and space complexity of the algorithm.  
5. Any best practices or tips for optimizing the implementation.  

Write the output in a professional yet approachable tone, as if explaining to a fellow developer who is familiar with Java but new to sorting algorithms. Use my communication style, which is concise, structured, and focused on practical application.

**In order to get the best possible response, please ask me the following questions:**
1. Do you want the explanation to include a visual representation of the algorithm (e.g., diagrams or pseudocode)?  
2. Should the implementation include edge case handling (e.g., empty arrays, already sorted arrays)?  
3. Do you want the code to include unit tests to validate the implementation?  
4. Should the explanation include comparisons with other sorting algorithms (e.g., Merge Sort, Bubble Sort)?  
5. Do you want the implementation to be optimized for readability, performance, or both?  
6. Should the explanation include real-world use cases for the Quick Sort algorithm?  
7. Do you want the explanation to cover recursive vs. iterative implementations?  
8. Should the code include comments explaining each step in detail?  
9. Do you want the explanation to include common pitfalls or mistakes to avoid?  
10. Should the output include a summary or key takeaways for quick reference?