Quick revision
- Auxiliary Space - extra space or temporary space used by an algorithm, excluding the space for the output
- It does not use any data structures that grow with the input size, so the space complexity is O(1), which is constant.
- Amortised - computes the average cost per operation over a (worst-case) sequence of operations by spreading occasional expensive steps across many cheap ones
- Although a single insert into a dynamic array may sometimes take O(n) when resizing, its amortised cost over n inserts is O(1).
- Union-Find’s find uses path compression, giving O(α(N)) amortised per operation, which for practical N is constant.
✅ Shortened "Strong Hire" Checklist (for quick reference)
- [ ] 1. Restate Problem Clearly
- [ ] 2. Clarify Constraints Explicitly
- [ ] 3. Outline & Confirm Test Cases
- [ ] 4. Compare Solutions (Naïve vs Optimal)
- [ ] 5. Discuss Complexity (Time & Space)
- [ ] 6. Confirm Approach with Interviewer
- [ ] 7. Write Modular & Commented Code
- [ ] 8. Actively Test Edge Cases
- [ ] 9. Propose Optimisations & Discuss Trade-offs
- [ ] 10. Confidently Summarise & Close
🎯 Mindset of a Strong Hire (Keep in Mind):