1,745 views
4 4 votes

You are  given a 1 billion numbers. The time require in seconds to sort them provided sorting thousand numbers takes 100 microseconds will be _______

  1. 10,000
  2. 512
  3. 300
  4. 65536

1 Answer

Best answer
11 11 votes
1 billion $= 10^9$

Apply best Sorting algorithm,
$T(n) = O(n\lg n) = k.n\lg n$

The time require in seconds to sort them provided sorting thousand numbers takes 100 microseconds
$100 \times 10^{-6} = k \times 1000 \lg 1000 \\\implies k = \frac{10^{-7}}{\lg 1000}$

For n = 1 Billion let $x$ be the requied time.
$x = k \times 10^9 \lg 10^9 \\=  \frac{10^{-7}}{\lg 1000} 10^9 \times \lg 10^9 \\=300 s$
• selected by
Answer:
Position:
Show:

Related questions

2 2 votes
2 answers 2 answers
1.4k
1.4k views
Bikram asked Oct 4, 2016
1,442 views
About how many compares will Quicksort() make when sorting an array of N items that are all equal?$\Theta(\lg N)$$\Theta(N\lg N)$$\Theta(\lg \lg N)$$\Theta(N/\lg N)$
2 2 votes
4 answers 4 answers
1.6k
1.6k views
Bikram asked Oct 4, 2016
1,596 views
Is an array that is sorted in decreasing order a max-heap?always yesalways nosometimes onlyyes but not in presence of duplicates
1 1 vote
1 answers 1 answer
823
823 views
Bikram asked Oct 4, 2016
823 views
Match the following two columns given in a table:1. Randomized quick sorta. $\Theta(n+k)$2. Insertion sortb. $\Theta\left(n^2\right)$3. selection sortc. $\Theta(n)$4. Buc...
2 2 votes
2 2 answers
1.0k
1.0k views
Bikram asked Oct 4, 2016
1,032 views
Match the following: i.BFSa.$O(\mid E \mid + \mid V \mid \log \mid V \mid)$ii.DFSb.$O(E)$iii.Kruskal's algorithmc.Stackiv.Dijikstra's Algorithmd.$O(E \log V)$i - b, ii - ...