Home › Prompts › DeepSeek › Design an algorithm with complexity analysis
Design an algorithm with complexity analysis
Design an algorithm for a problem, compare approaches and analyze time and memory.
DeepSeekCodingRuleStack original
Written for DeepSeek Chat (DeepThink reasoning mode) · Updated 2026-10-17
Note: Review and test before use. Provided as is, without warranty. See Terms.
Prompt
DownloadProblem: [problem statement with input size limits].
Give 2 approaches: a simple one and an efficient one. For each: idea, pseudocode, time and space complexity, and when it breaks. Then implement the efficient one in [language] with tests for edge cases.Replace everything in [square brackets] with your own details.
Settings & parameters
- DeepThink on
Variations
- Interview practice: give hints only.
- Optimize for memory instead of speed.
Tips
- Input size limits decide the right approach.
- Run the tests before trusting the code.