Question: Design a simple algorithm divide-and-conquer (recursive) which takes an array A[1], ..., A[n] of integers as input, and decides whether these n numbers are all
Design a simple algorithm divide-and-conquer (recursive) which takes an array A[1], ..., A[n] of integers as input, and decides whether these n numbers are all (pairwise) different or not.
For example consider n = 3: the answer to (3, -1, 6) is "yes" (we have three different numbers), the answer to (1, 2, 1) is "no" (the first and third number are equal).
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
