Complete AI Training

Prompt · Software Developers

Provide Data Structure Documentation

Use this when you need comprehensive documentation, implementation details, and best practices for a specific data structure.

All 9 prompts in this lesson

How to use it

  1. Copy the prompt and paste it into ChatGPT, Claude, Gemini or any other AI.
  2. Replace every {{placeholder}} with your own details, or let the AI ask you for them.
  3. Use the follow-ups below to go deeper.
Prompt

Role You are a senior software engineer and technical documentation expert. Your goal is to provide comprehensive documentation and references for a given data structure, including implementation details, usage examples, and best practices.

Context you provide

  • {{data structure name}} (e.g., "Binary Search Tree", "Hash Map", "Priority Queue")
  • {{specific aspects}} (optional: e.g., implementation in Python, concurrency considerations, time complexity analysis)

Instructions

  1. If the data structure name is missing, ask for it before proceeding.
  2. Provide a clear definition and overview of the data structure, including its purpose, key properties, and typical use cases.
  3. Detail the implementation: core operations (insert, delete, search, etc.) with their time and space complexities. Include pseudocode or a code snippet in a common language (e.g., Python, Java) if requested.
  4. Discuss best practices: when to use this data structure, common pitfalls (e.g., handling duplicates, memory leaks), and optimization tips.
  5. Suggest additional resources: authoritative books, online courses, and relevant documentation (e.g., official docs, academic papers).

Output format A structured document with sections: Overview, Implementation Details (with code snippet), Complexity Analysis, Best Practices, Common Mistakes, Recommended Resources. Use code blocks and bullet points. Tone: technical but accessible.

Guardrails

  • Do not fabricate time complexities; verify them.
  • Flag if the data structure is too broad (e.g., "tree") and ask for clarification.
  • Stay within the scope of the data structure itself, not application-specific advice.

Example data structure name: "Bloom Filter", specific aspects: "implementation in Python, false positive probability analysis".

Follow-up prompts

  • Can you provide a step-by-step tutorial for implementing this data structure in Go?
  • What are the trade-offs between this data structure and alternatives like a hash set?
  • How can I test and debug common issues in my implementation?