in GATE retagged by
416 views
0 votes
0 votes

Partitioning and Merging are the two main parts of $Quick Sort$.

 Which of the following is TRUE?

  1.     Partitioning is the key step while Merging is trivial.
  2.     Partitioning is trivial while Merging is the key step.
  3.     Both Partitioning and Merging are trivial.
  4.     Both Partitioning and Merging are key steps.
in GATE retagged by
by
416 views

2 Comments

This is a vague question because "key" and "trivial" have no formal definition. But according to the context, A is the most correct option.
0
0

Partitioning is definitely important.

But the quicksort's second recursive call to itself can be replaced by an iterative procedure. This technique of replacing the second recursive call by an iterative sequence is called "tail recursion"

Merging is involved after partition, so maybe tail recursion can take care of it, and hence merging is trivial.


CLRS page 188.

1
1

3 Answers

2 votes
2 votes
Best answer
In quick sort, partitioning is key as it needs selecting the pivot and then partitioning the array into two parts with one part > pivot and other <= pivot.
Merging is trivial where nothing is required.
selected by

1 comment

What exactly key and trivial here Sir?
1
1
0 votes
0 votes

ANSWER IS (A.) Partitioning is the key step while Merging is trivial.

0 votes
0 votes

ANSWER IS (A.) Partitioning is the key step while Merging is trivial.

Answer:

Related questions

Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true

64.3k questions

77.9k answers

244k comments

80.0k users