In the following algorithm, what is the "conquer" step of the divide and conquer approach?
You are trying to sort a list of basketball players by the number of points they scored in a game. To do this you divide the list into smaller lists consisting of two players each. You compare the two players in each list and sort them by who has the higher number of points. You do this comparison for every pair of lists and combine the lists to make bigger sorted lists until the entire list is sorted.
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
To solve the question, we need to know the definition of divide, conquer, and combine.
The first option has the word "dividing" in it, so it's a divide phase. The second one has the word "combining" in it, so it's a combine phase. Although the third option doesn't has any word related to "conquer", but the option shows that it's trying to solve the subproblem, so it is a conquer phase. And so, the answer is option number three.