1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
weeeeeb [17]
4 years ago
8

Use Quicksort algorithm to sort the following list of random numbers. Show all steps. Derive the time complexity of Quicksort an

d find the asymptotic notation using master theorem.
3 | 4 | -2 | 8 | 10 | 5 | 0 | 7 | 12 | 14 | 9 | 6 | 8 |1 | 5
Computers and Technology
1 answer:
Zigmanuir [339]4 years ago
6 0

Answer:

Quick Sort is a Divide and Conquer algorithm which picks an element as a pivot which divide the array into two halves.

Sorted Array -2 | 0 | 1| 3| 4| 5 | 6| 7 | 8| 9 |10 | 12 |14| now array is sorted

Time Complexity of Quick Sort = = O ( n log n )

asymptotic notation using master theorem = T(n) = aT (n/b) + θ ( n^k log^p n)

Explanation:

Quick Sort is a Divide and Conquer algorithm which picks an element as a pivot which divide the array into two halves. There are many types of Quick Sort as

  •  Pick the first element as pivot
  • pick the last element
  • pick random element
  • pick median element

3 | 4 | -2 | 8 | 10 | 5 | 0 | 7 | 12 | 14 | 9 | 6 | 8 |1 | 5 //5 as a pivot

-2 | 3 | 4| 8| 5| 0| 7 |10 |12| 14 | 9 | 6 | 1| 5| 8 //8 as pivot

-2 | 0 | 1| 3| 4| 5 | 6| 7 | 8| 9 |10 | 12 |14| now array is sorted

here pick a point as initial values first pick 5 as pivot then compare the 5<values if it id true then swap it of it is false move towards next and check the condition. Similarly half array is sorted pick 8 as pivot point then do the same procedure and sort the other half array.

Time Complexity of Quick Sort

T(n) =a

= 2T(n/2) + n

= 2( 2T (n/4) + n/2) + n

= 2² T (n/2²) +n +n

= 2² (2t(n/2³)+n/4 ) +n +n

= 2³T (n/2³) + n +n +n

= 2^k T ( n/ 2^k) + nk

= nT( n/n ) + n log n

= na + n log n

= O ( n log n )

asymptotic notation using master theorem.

T(n) = aT (n/b) + θ ( n^k log^p n)

a = number in the recursion and a >= 1

n/b = size of each sub problem

b > 1, k >= 0 and p is a real number.

You might be interested in
Amina question and any other )
Anon25 [30]

Answer:

h b

Explanation:

8 0
3 years ago
Desktop publishing design tools are represented by A. icons. B. windows. C. trackballs. D. modems.
AnnZ [28]
The best answer is A
Windows are the screens you can maximize and minimize.
Trackballs make the mouse move.
Modems are associated with internet connection.
Those three answers are unrelated leaving icons to be the most reasonable.
3 0
3 years ago
Match each Excel term to its definition. cell a group of cells containing related data ribbon a row of tabs, groups, and command
Artist 52 [7]

Answer:

ribbon- a row of tabs, groups, and commands

range- a group of cells containing related data

title bar- file name

cell- a container used to input data

worksheet- Excel’s version of a spreadsheet

Explanation:

6 0
3 years ago
The computers in the administrative offices of the four schools throughout the district are networked to enable employees to acc
muminat
These computers in administrative offices or schools throughout the district that are networked to each other has the type of network most likely used by the workers is LAN network. Usually LAN networks are used in small offices or rooms.
3 0
4 years ago
Fill in the blank with the correct response.
Karo-lina-s [1.5K]

Answer:

logical

Explanation:

4 0
3 years ago
Read 2 more answers
Other questions:
  • Which sector provides scope for multimedia designers?
    10·1 answer
  • Dueto working at home, lack of interaction may result in ___________ professionalgrowth.
    14·1 answer
  • Josh wants to sign up for a gaming website. It will allow him to download games. He can’t find a privacy policy. Should he join
    9·2 answers
  • Identify the characteristics of logic problems.select all that apply
    5·1 answer
  • Different network devices function at different network communication layers, depending on their purpose. Using the TCP/IP model
    7·1 answer
  • Which features of words are used to separate numbers and texts into columns
    11·1 answer
  • In addition to regular watch features, which two features are often found on smart watches?
    10·1 answer
  • HI brainly friends....<br> Pease thanks my answers I will also thank your answers
    11·1 answer
  • False
    8·1 answer
  • List three types of Software:
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!