Join Nostr
2026-10-25 13:37:50 UTC

codementor on Nostr: Learn: Divide and conquer The pattern: split the problem into smaller parts of the ...

Learn: Divide and conquer

The pattern: split the problem into smaller parts of the same kind, solve each part (usually with recursion), then combine the answers.

Examples: merge sort (split, sort halves, merge), quick sort, binary search (keep only one half).

Why it helps: splitting in half again and again gives about log n levels, which is where the "log n" in O(n log n) comes from.

Read more: https://www.geeksforgeeks.org/dsa/divide-and-conquer/

#tip · TIP-036