Question

QuickSort is asymotivaly faster than bubblsort

0 0
Add a comment Improve this question Transcribed image text
Answer #1

a) Quicksort is asymptotically faster than bubblesort


Answer:
In the worst case --------- No

On average ------------- Yes


Explanation :

Quick sort takes O(n log n) comparisions on an average.

In the worst case O (n 2) for both sorting techniques.

b) Quicksort is asymptoticallly slower than mergesort

Answer:

In the worst case ------ Yes

On average --------- No

Explanation:

Merge sort takes O(n log n) comparisions on in any case.

In the worst case O (n 2) for quick sort.

c) To sort 8 numbers it is necessary to make at least

Answer:

16 comparisions ------ Yes
17 comparisions ----- Yes
18 comparisions ------ Yes


Explanation:

It depends on the sorting algorithm which is used.

O( n 2 ) in the worst case.


d) To find 2 heavier coins among 14 same coins using lever scales it is necessary to make at least

4 comparisions ------ Yes
5 comparisions ----- Yes

Explanation :
You should use the following formula to get the actual value

( r + n - 1 ) !
----------------
r ! (n-1) !

Add a comment
Know the answer?
Add Answer to:
QuickSort is asymotivaly faster than bubblsort Quicksort is asymptotically faster than bubblesort In the worst case...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Yes No No Yes Quicksort is asymptotically faster than bubblesort - a. In the worst case...

    Yes No No Yes Quicksort is asymptotically faster than bubblesort - a. In the worst case b. On average To sort 8 numbers it is necessary to make at least a. 17 comparisons b. 18 comparisons No Yes Yes No

  • Data Structure Question. I need help solving this question. I know quicksort has the worst case...

    Data Structure Question. I need help solving this question. I know quicksort has the worst case of O(n^2) if it is implemented choosing the pivot as the first element. A[1] is the first element here. Please justify why the number of comparison is the smallest possible number assuming the array ensures that. And give an example of that type of an array. Thank you thumbs up will be given for correct and justified answer! qs(A): if A has at most...

  • Objective: Write a program that implements the Game of Life cellular automata system invented by John...

    Objective: Write a program that implements the Game of Life cellular automata system invented by John Conway. 1. Create two game grids of size at least 50x50. These grid cells can be either Boolean or integer. In the following, I’ll refer to these as gridOne and gridTwo. 2. Set all cells in both grids to false. 3. Start by initializing gridOne. Allow the user to specify two different ways of initializing the grid: 1) by specifying a pattern file to...

  • Case: Criticizing customers. Short-changing workers. Sassing regulators. Deceiving authorities. Emphasizing rule breaking and ruthlessness in a...

    Case: Criticizing customers. Short-changing workers. Sassing regulators. Deceiving authorities. Emphasizing rule breaking and ruthlessness in a “win at all costs” workplace culture. Is this what it takes to go from startup to a $70 billion business in only seven years? Or are these characterizations false, the criticisms of jealous rivals? Let’s take an extended look at the exciting journey of the low-cost ridehailing service known as Uber, or Uber Technologies Inc., one of the leading transportation services of the world....

  • How can we assess whether a project is a success or a failure? This case presents...

    How can we assess whether a project is a success or a failure? This case presents two phases of a large business transformation project involving the implementation of an ERP system with the aim of creating an integrated company. The case illustrates some of the challenges associated with integration. It also presents the obstacles facing companies that undertake projects involving large information technology projects. Bombardier and Its Environment Joseph-Armand Bombardier was 15 years old when he built his first snowmobile...

  • What is the role of polymorphism? Question options: Polymorphism allows a programmer to manipulate objects that...

    What is the role of polymorphism? Question options: Polymorphism allows a programmer to manipulate objects that share a set of tasks, even though the tasks are executed in different ways. Polymorphism allows a programmer to use a subclass object in place of a superclass object. Polymorphism allows a subclass to override a superclass method by providing a completely new implementation. Polymorphism allows a subclass to extend a superclass method by performing the superclass task plus some additional work. Assume that...

  • 10. Write a one-page summary of the attached paper? INTRODUCTION Many problems can develop in activated...

    10. Write a one-page summary of the attached paper? INTRODUCTION Many problems can develop in activated sludge operation that adversely affect effluent quality with origins in the engineering, hydraulic and microbiological components of the process. The real "heart" of the activated sludge system is the development and maintenance of a mixed microbial culture (activated sludge) that treats wastewater and which can be managed. One definition of a wastewater treatment plant operator is a "bug farmer", one who controls the aeration...

  • summatize the following info and break them into differeng key points. write them in yojr own...

    summatize the following info and break them into differeng key points. write them in yojr own words   apartus 6.1 Introduction—The design of a successful hot box appa- ratus is influenced by many factors. Before beginning the design of an apparatus meeting this standard, the designer shall review the discussion on the limitations and accuracy, Section 13, discussions of the energy flows in a hot box, Annex A2, the metering box wall loss flow, Annex A3, and flanking loss, Annex...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT