retagged by
1,666 views

1 Answer

2 votes
2 votes

Using Bubble sort

In worst case number of comparison O(n2).

(200)2=200 sec

So for n2=800 sec

n2=160000

n=400

Alternatively

for 200 names =200*199/2

                        =19900 comparison

So 19000 c=200 sec

n(n-1)/2=800 sec

so n(n-1)/2=79600

n=400 apx

A similar question of this type was asked earlier. Kindly refer d link below for more explanation.

I have take d solution from there alone

https://gateoverflow.in/27429/hashing

Related questions

0 votes
0 votes
1 answer
2
Bharani Viswas asked May 17, 2016
547 views
m trying to understand a few sorting algorithms, but I'm struggling to see the difference in the bubble sort and insertion sort algorithm.in a particular case where the e...
2 votes
2 votes
1 answer
4
Mak Indus asked Dec 18, 2018
5,568 views
How many passes of bubble sort are required to sort the following sequence (Pass is counted only when at least one swap is performed in the bubble sort pass)? ...