Ask Question
4 March, 18:35

A sorting algorithm takes 1 second to sort n = 1000 items.

1) How many operations will be performed if the sorting algorithm is O (n2) (approximately) ?

2) How long will it take to sort 10,000 items if the sorting algorithm is O (n2) ?

3) How much time will one operation take if the sorting algorithm is O (n2) ?

+4
Answers (1)
  1. 4 March, 21:23
    0
    1.1,000,000,

    2, 1 minute 40 secs

    3.10^-6 secs

    Step-by-step explanation:

    sorting algorithm takes 1 second to sort n = 1000 items.

    1) How many operations will be performed if the sorting algorithm is O (n2) (approximately) ?

    2) How long will it take to sort 10,000 items if the sorting algorithm is O (n2) ?

    3) How much time will one operation take if the sorting algorithm is O (n2) ?

    algorithm takes time proportional to n^2,

    1. then 1,000^2=1,000,000,

    2. if it takes 1 secs to generate 1000 items

    yhen n^2=1000^2=1000000 and 10,000^2=100,000,000.

    Dividing by 100. Therefore, the sorting algorithm would take

    1 minute and 40 seconds to sort 10,000 items.

    3. How much time will one operation take if the sorting algorithm is O (n2) ?

    1/1000^2

    10^-6 secs to sort 1 operations
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “A sorting algorithm takes 1 second to sort n = 1000 items. 1) How many operations will be performed if the sorting algorithm is O (n2) ...” in 📘 Mathematics if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers