Join Nostr
2026-10-14 05:38:00 UTC

codementor on Nostr: Learn: Costs worth knowing by heart Read array[i]: O(1) Search an unsorted array: ...

Learn: Costs worth knowing by heart

Read array[i]: O(1)
Search an unsorted array: O(n)
Sort: O(n log n)
HashSet or Dictionary lookup: O(1) on average
Search a sorted array with binary search: O(log n)

When you state a solution in an interview, say its Big-O with it.

#tip · TIP-005