Ask Question
31 July, 16:57

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) ?

+2
Answers (1)
  1. 31 July, 19:07
    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?
Get 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 there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers