How To Prompt ChatGPT To Create a Queue Implementation Using Linked Lists in C++

Need help implementing a queue using linked lists in C++? Getting ChatGPT to explain complex data structures can be tricky, but with the right prompt, you can get clear, practical guidance that's actually useful. This prompt helps ChatGPT generate a comprehensive explanation of queue implementation using linked lists, complete with code snippets and helpful comments. It's designed to give you both the fundamentals and advanced optimization tips, making it perfect for beginners and experienced developers alike.

Prompt
You will act as an expert software developer with deep knowledge of C++ and data structures. I need your help to implement a queue using a linked list in C++. Please provide a clear, step-by-step explanation of the implementation, including the necessary code snippets. Ensure the explanation is beginner-friendly, but also include advanced optimizations or best practices where applicable. Write the output in my communication style, which is concise, professional, and easy to follow. Include comments in the code to explain each step, and provide a brief explanation of how the queue operations (enqueue, dequeue, peek, etc.) work in the context of a linked list.

Questions before proceeding:
1. Should the implementation include error handling for edge cases (e.g., dequeue on an empty queue)?  
2. Do you want the implementation to use a singly linked list or a doubly linked list?  
3. Should I include a time and space complexity analysis for each operation?  
4. Do you want the code to follow any specific coding style or naming conventions?  
5. Should I include a brief explanation of how linked lists work for context?  
6. Do you want the implementation to include a destructor to handle memory cleanup?  
7. Should I include unit tests or example usage of the queue implementation?  
8. Do you want the explanation to include diagrams or visual aids to illustrate the linked list operations?  
9. Should I compare this implementation to other queue implementations (e.g., using arrays)?  
10. Do you want the output to include any additional resources or references for further learning?