Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

A divide-and-conquer algorithm solves a problem by splitting it into smaller instances, solving those instances recursively, and combining their answers. The method is defined by three stages—divide, conquer, and combine—plus base cases that stop the recursion. Its running time follows a recurrence describing how many subproblems are created, how large they are, and how much work is done outside the recursive calls.

The three stages of divide and conquer

1. Divide

Break the original problem into smaller subproblems. A balanced split is common, but it is not required; what matters is that the subproblems are simpler versions of the original task.

2. Conquer

Solve each subproblem, usually by applying the same algorithm recursively. A base case handles inputs small enough to solve directly, such as an array containing zero or one item.

3. Combine

Use the subproblem answers to construct the answer for the original input. In many important algorithms, the combine step contains the central insight and determines the overall efficiency.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Elebase USB to USB C Adapter for iPhone 18 Pro Max,USBC Car Charger Adapter
  • Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
  • Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
  • Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
  • Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
  • 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.

Divide and conquer is not simply “recursion.” A recursive algorithm qualifies when it creates smaller, usually independent subproblems and combines their solutions into one result. Recursive tree traversal, for example, may not have the same divide-and-combine structure.

How the recurrence describes performance

Write a recurrence by answering four questions:

  • How many recursive subproblems are there?
  • What size is each subproblem?
  • How much non-recursive work occurs in one call?
  • How many levels are needed before reaching a base case?

A common form is T(n) = aT(n/b) + f(n), where a is the number of subproblems, each subproblem has size n/b, and f(n) is the work for dividing and combining. Recursion-tree reasoning or the Master Theorem can then provide an asymptotic bound. These bounds describe growth as input size increases; they are not benchmark measurements.

Merge sort: a complete worked example

Algorithm steps

  1. Divide: split the array into two halves.
  2. Conquer: recursively sort each half.
  3. Combine: merge the two sorted halves by repeatedly taking the smaller next element.

When a half has at most one element, it is already sorted and recursion stops.

Rank #2
Anker USB-C Hub, 5-in-1 USB Hub for Laptops, 4K HDMI Multiport Adapter
  • 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
  • 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
  • Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
  • 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
  • What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.

Merge sort recurrence

Merge sort makes two recursive calls on inputs of size approximately n/2. The merge scans all n elements once, so the non-recursive work is linear:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

T(n) = 2T(n/2) + Θ(n)

The recurrence resolves to Θ(n log n), the asymptotic result given in MIT OpenCourseWare’s 2020 6.006 Recitation 3 notes. The logarithm comes from repeatedly halving the input; the linear factor comes from processing all elements at each recursion level.

Space, stability, and implementation trade-offs

  • Auxiliary storage: the standard implementation uses linear temporary storage for merging.
  • In-place behavior: that standard implementation is not in-place.
  • Stability: merge sort can be stable when the merge chooses the element from the left run first when keys tie.
  • Predictability: its asymptotic running time remains Θ(n log n) for best, average, and worst input orders.

Whether merge sort is preferable depends on constraints such as memory availability, the need for stable ordering, data movement costs, and whether an in-place algorithm is required.

Rank #3
Sale
Anker USB C Hub, 7in1 Multi-Port USB Adapter, 4K@60Hz USBC to HDMI Splitter
  • Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
  • Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
  • Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
  • Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
  • What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.

Closest pair of points: why the combine step matters

In the planar closest-pair problem, the goal is to find the two points with the smallest Euclidean distance. A divide-and-conquer solution first presorts the points, divides them by a vertical line, recursively finds the closest pair in each half, and lets δ be the smaller of those two distances.

The combine step examines only points within a vertical strip of width determined by δ. Geometric packing arguments limit how many candidates each point must be compared with, keeping the strip work linear for a level. The resulting recurrence is:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

T(n) = 2T(n/2) + O(n)

and the running time is O(n log n), as analyzed in MIT’s 6.046J complete lecture notes.

Rank #4
Sale
UGREEN USB to USB C Adapter Combo 4-Pack, 10Gbps USB C Converter Space Gray
  • Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
  • Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
  • Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
  • Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
  • Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft

Preserving useful ordering information across recursive calls is essential. If every call sorts its points from scratch, the additional sorting work changes the cited analysis to O(n(log n)2). This illustrates a general rule: repeated preprocessing inside recursion can change the recurrence and the final complexity.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Other divide-and-conquer examples

MIT algorithm-course materials use the pattern across several domains:

  • Fast Fourier transform (FFT): recursively splits a transform into smaller even- and odd-indexed transforms and combines them with structured arithmetic.
  • Strassen’s matrix multiplication: partitions matrices and reduces the number of recursive multiplications compared with the straightforward method.
  • Polynomial multiplication: splits coefficient ranges and combines partial products.
  • Convex hull: solves geometric subsets and merges their boundary structures.
  • Selection and median finding: reduces the search to smaller regions while maintaining enough information to identify the target order statistic.
  • Fibonacci-related algorithms: course treatments include divide-and-conquer formulations, although not every recursive Fibonacci implementation has efficient independent subproblems.

The label applies to the structure, not to recursion alone: independent smaller instances must be solved and their results combined into the original answer.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
Anker USB C Hub, 5-in-1 USBC to HDMI Splitter with 4K Display
  • 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
  • Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
  • Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
  • HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
  • What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.

How to recognize or design one

  1. Define the original input and the result it must produce.
  2. Find a natural way to create smaller instances of the same problem.
  3. Specify the base case precisely.
  4. Determine whether subproblems can be solved independently or whether shared state is required.
  5. Design the combine operation and bound its cost.
  6. Write the recurrence using the exact number and sizes of recursive calls.
  7. Check whether preprocessing, copying, or sorting is repeated at every call.
  8. Validate memory use, recursion depth, ordering requirements, and edge cases.

What to compare between divide-and-conquer algorithms

Comparison factor Question to ask
Subproblem structure How many subproblems are created, and how large are they?
Combine work Is the non-recursive work constant, logarithmic, linear, or larger per level?
Recursion depth How many levels occur, and could stack depth become a practical limit?
Preprocessing reuse Can sorted order or other metadata be carried into recursive calls?
Memory How much temporary storage and call-stack space are required?
Data-order behavior Does the algorithm preserve stability or require an in-place implementation?

Two algorithms with the same asymptotic bound can behave differently because of allocation, cache behavior, copying, recursion overhead, or workload-specific constraints. Choose using the actual input and implementation requirements rather than the recurrence alone.

Further reading

For a textbook treatment, see Introduction to Algorithms, 3rd edition, by Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, and Clifford Stein (MIT Press, 2009; ISBN 9780262033848). MIT’s Fall 2005 SMA 5503 reading list assigns chapters on algorithm analysis and divide-and-conquer.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.