O1 Constant Time
1 min readRapid overview
O(1) - Constant Time
Operations that execute in a fixed amount of time regardless of input size.
const first = items[0];
const hasUser = userMap.has(userId);
Notes
- Array index access is O(1).
- Map/Set insert and lookup are average O(1).