Computer Science > QUESTIONS & ANSWERS > University of Maryland, College ParkCMSC 351hwk8-sol-ALL ANSWERS CORRECT-GRADED A. (All)

University of Maryland, College ParkCMSC 351hwk8-sol-ALL ANSWERS CORRECT-GRADED A.

Document Content and Description Below

1. One way to find the median of a list is to sort the list and then take the middle element. (a) Assume you use Bubble Sort to sort a list with 13 elements (i.e. n = 13). Exactly how many compariso... ns do you use (in the worst case)? Solution: n(n − 1) 2 = 13(13 − 1) 2 = 78 (b) Assume you use Mergesort to sort a list with 13 elements (i.e. n = 13). Exactly how many comparisons do you use (in the worst case)? Solution: 37 2. You can actually find the median by running a sorting algorithm and stopping early, as soon as you know the median. (a) Assume you use Bubble Sort to find the median of 13 elements (i.e. n = 13), but stop as soon as you know the median. Exactly how many comparisons do you use (in the worst case)? Solution: 12 + 11 + 10 + 9 + 8 + 7 + [Show More]

Last updated: 1 year ago

Preview 1 out of  pages

Add to cart

Instant download

document-preview

Buy this document to get the full access instantly

Instant Download Access after purchase

Add to cart

Instant download

Reviews( 0 )

$5.00

Add to cart

Instant download

Can't find what you want? Try our AI powered Search

OR

REQUEST DOCUMENT
3
0

Document information


Connected school, study & course


About the document


Uploaded On

May 03, 2021

Number of pages

Written in

Seller


seller-icon
d.occ

Member since 3 years

228 Documents Sold


Additional information

This document has been written for:

Uploaded

May 03, 2021

Downloads

 0

Views

 3

Document Keyword Tags

What is Browsegrades

In Browsegrades, a student can earn by offering help to other student. Students can help other students with materials by upploading their notes and earn money.

We are here to help

We're available through e-mail, Twitter, Facebook, and live chat.
 FAQ
 Questions? Leave a message!

Follow us on
 Twitter

Copyright © Browsegrades · High quality services·