in Others reshown by
149 views
1 vote
1 vote
Give a strategy to sort four distinct integers a, b, c, d in increasing order that minimizes the number of pairwise comparisons needed to sort any permutation of a, b, c, d.
in Others reshown by
149 views

1 Answer

1 vote
1 vote

@rsansiya111

It will be merge sort...

a,b,c,d ...

No of comparisons

= ceil (log n! )

= ceil (log 24)

= 5 ...

 

1. https://gateoverflow.in/48028/Isi2011-pcb-a-2a

 

by

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