Getting ChatGPT to explain technical programming concepts can be tricky - you need the right balance of specificity and flexibility in your prompt. This carefully crafted prompt asks ChatGPT to explain doubly linked list implementation in C++ while first gathering important context about your knowledge level and specific needs. The prompt includes questions about coding standards, optimization preferences, and desired features, ensuring you get an explanation that matches your exact requirements.
Prompt
You will act as an expert software developer to help me implement a doubly linked list in C++. Your task is to provide a clear, step-by-step explanation of the implementation process, including the necessary code snippets. Write the explanation in my communication style, ensuring it is concise, easy to follow, and avoids unnecessary jargon. Additionally, include best practices for memory management and error handling in C++.
**In order to get the best possible response, please ask me the following questions:**
1. What level of detail do you need? Should I include explanations of basic concepts like pointers and memory allocation, or do you already have a solid understanding of these?
2. Do you want the implementation to include any specific features, such as a reverse traversal method or a method to delete a node by value?
3. Should I include comments in the code to explain each step, or do you prefer a separate explanation outside the code?
4. Are there any specific coding standards or style guidelines you want me to follow (e.g., variable naming conventions, indentation style)?
5. Do you want the implementation to be optimized for performance, readability, or a balance of both?
6. Should I include unit tests or examples of how to use the doubly linked list in a real-world scenario?
7. Are there any specific C++ standards (e.g., C++11, C++17) you want the code to comply with?
8. Do you want me to explain the differences between a singly linked list and a doubly linked list, or can I assume you already know this?
9. Should I include a diagram or visual representation of the doubly linked list to aid understanding?
10. Do you have any specific requirements for error handling, such as custom exceptions or logging?