Question

Q3. Answer the following questions: a) Explain why Merge sort is the most suited for very...

Q3. Answer the following questions: a) Explain why Merge sort is the most suited for very large inputs (that do not fit inside memory) while quick sort and heap sort are not as suited. Note that these three sorting techniques have comparable time complexities. b) Can Merge sort be performed in place? Explain your understanding.

no handwriting please

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

a) Merge sort is most suited for large inputs that do not fit in memory while quick sort and heap sort are not suited.

The reason is to perfrom quick sort or heap sort we need to consider all elements at a time.

merge sort is suitable because we can perform sorting using sub arrays,and sorted array can be copied back to secondary memory,and we can fetch the rest of the elements in various phases.

similary we can perfrom merging process for large set of data items.

in case of quick sort or heap sort we have to use all elements at a time, but they cant be copied to main memory at a time due to memory size costraint.

b)Can Merge sort be performed in place?

Merge sort cannot be performed in place, because while performing merging process, we merge two subarrays every time, we need to maintain temporary array to merge sub arrays in everystep until we reach the size of the original array.

Add a comment
Know the answer?
Add Answer to:
Q3. Answer the following questions: a) Explain why Merge sort is the most suited for very...
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
  • A. What is the time complexity of Merge Sort? B. Explain why Merge Sort has the...

    A. What is the time complexity of Merge Sort? B. Explain why Merge Sort has the time complexity you listed above in Part A. Algorithm Quicksort (A, left, right) if (left < right) pivot Point = [(left+right)/2] 11 note central pivot i left - 1 ja right + 1 do do it i +1 while (i < A.size) and (A[i] SA[pivot Point]) do jj-1 while (j > i) and (A[il > A[pivot Point]) if (i <j) then swap (A[i], Aljl)...

  • Java Question: Code the Merge Sort in such a way that it outputs the number of...

    Java Question: Code the Merge Sort in such a way that it outputs the number of comparisons and the number of swaps performed when sorting a random set of items. Then use it to sort 1000, 5000, 10,000, and 100,000 integers. Tabulate the results and compare it to the number of comparisons and swaps calculated using the formulas given in Table 8.6. Table 8.6 Performance of the Quicksort Algorithm Speed Memory Overhead Range Bytes lgorithm Range Effort Comments Binary Tree...

  • Using Merge Sort: (In Java) (Please screenshot or copy your output file in the answer) In...

    Using Merge Sort: (In Java) (Please screenshot or copy your output file in the answer) In this project, we combine the concepts of Recursion and Merge Sorting. Please note that the focus of this project is on Merging and don't forget the following constraint: Programming Steps: 1) Create a class called Art that implements Comparable interface. 2) Read part of the file and use Merge Sort to sort the array of Art and then write them to a file. 3)...

  • SHORT ANSWER QUESTIONS Part 1 Classes Abstraction: What is Abstraction in terms of representation? Specifically what...

    SHORT ANSWER QUESTIONS Part 1 Classes Abstraction: What is Abstraction in terms of representation? Specifically what choices does one make when creating a class that is an example of Abstraction? Encapsulation: What is encapsulation? What is information hiding? What does a public interface to a class consist of (not in the sense of actual java interfaces but what the client uses to manipulate objects of the class) What is an object of a class? What is the constructor? How do...

  • Please analyse the case study and answer 2 following questions. Thanks! a) Explain why Myanmar should/should...

    Please analyse the case study and answer 2 following questions. Thanks! a) Explain why Myanmar should/should not use protectionist policies b) Present a country that also has applied IIP in the past to evaluate its costs and benefits Myanmar is working hard to make the difficult economic transition from its current status as a Least Developed Country to its once-held spot as one of the most developed Asian economies. Urged on by many international and domestic experts, sweeping liberalisation reforms...

  • A critical introduction into the study of religion. Explain why Martin treats religion as a social...

    A critical introduction into the study of religion. Explain why Martin treats religion as a social construct—both the category ‘religion’ and the stuff it denotes—using Kessler’s discussion of the Dao and Anselm as examples. How Society Works: Essentialism Animism and Essentialism According to some of the theories of primitive savages and primitive religion discussed briefly in Chapter 1, religion originated when ancient peoples attempted to understand and explain mysterious forces whose causes were beyond their primitive" understanding. What causes thunder?...

  • 5. Please answer the following questions with respect to PLC Theory (8) a. Which phase of...

    5. Please answer the following questions with respect to PLC Theory (8) a. Which phase of the PLC is the pizza business? What indicators can you list? b. Given the phase of the PLC you indicated at part a: 1. What marketing mix strategies would you expect Dominos to be using? il. What marketing mix strategies is Dominos actually using? Ill. What disconnects, issues or questions arise from parts I and il above? The Strategy Carrying Domino's to New Heights...

  • Please provide a summary of this case and answer ALL posted questions. Thank you so very...

    Please provide a summary of this case and answer ALL posted questions. Thank you so very much in advance! closing case The Decline of Zimbabwe wew the lowest econom 2000. Between 1999 and 2009 I 1980. the southern Ac e of imbabwe gained independence growth rate ever recorded with an ecline of 6.1 percent in from colonial master, Great Britain. Speaking of the time, the late The decline occurred after Mugabe launched a "fast-track and room Tanzania President, Julius Nyerere,...

  • A new version of the operating system is being planned for installation into your department’s production...

    A new version of the operating system is being planned for installation into your department’s production environment. What sort of testing would you recommend is done before your department goes live with the new version? Identify each type of testing and describe what is tested. Explain the rationale for performing each type of testing. [ your answer goes here ] Would the amount of testing and types of testing to be done be different if you were installing a security...

  • Outline and answer all discussion questions following case description in details. (Do not attempt to solve...

    Outline and answer all discussion questions following case description in details. (Do not attempt to solve if you can not fulfill all the requirements!!!!) THE ENERGY BAR INDUSTRY In 1986, PowerBar, a firm in Berkeley, California, single-handedly created the energy bar category. Positioned as an athletic energy food, it was distributed at bike shops and events that usually involved running or biking. The target segment was the athlete who needed an efficient, effective energy source. Six years later, seeking to...

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