Given a set M, find if there is a pair of numbers (a,b), both belong to M, and a+b=x, where x is a previously specified parameter. The problem should be solved using Divide et Impera in O(n * log n). Probably the problem should be split in two half-sized subproblems and then recombine the results in O(n).
I would like a pseudocode for the given problem or a tip for solving it.
Not sure if this fits your requirements, but:
The divide and conquer sort is O(n lg n), the stepping through the sorted set is O(n), therefore total complexity O(n lg n).
Ed: sum to x, not M.