1 votes 1 votes A machine takes 200 second to sort 200 names, using bubble sort . In 800 seconds , it can approximately sort how many names? Algorithms sorting time-complexity algorithms + – PriDix asked Feb 26, 2017 • retagged Jun 22, 2022 by makhdoom ghaya PriDix 1.7k views answer comment Share Follow See all 0 reply Please log in or register to add a comment.
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 Devshree Dubey answered Feb 26, 2017 Devshree Dubey comment Share Follow See 1 comment See all 1 1 comment reply Arjun commented Feb 27, 2017 reply Follow Share @Devshree Once you refer and understand a solution it is all yours. You can use and answer another question using your own words and understanding. There is no need to link to the original source for this. Because you are also preparing and concepts should be strong :) (I need not mean that one should copy from other sources, but instead must completely understood a solution and apply it oneself). 1 votes 1 votes Please log in or register to add a comment.