Computer Science: An Overview (13th Edition) (What's New in Computer Science)
13th Edition
ISBN: 9780134875460
Author: Glenn Brookshear, Dennis Brylow
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Question
Chapter 12, Problem 42CRP
Program Plan Intro
Merge sort:
Merge sort is a divide and conquer
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
Create an Algorithm to demonstrate the rapid sort operation. The algorithm leverages the Divide and Conquer principle by partitioning the list into two sublists and then recursively using procedure QUICK SORT to sort the two sublists.
Given these 8 numeric values to be sorted using the recursive Mergesort algorithm:
92 63 24 18 69 27 64 43
The list that will be passed to the first call of the Mergesort algorithm will be the entire list of values above.
Show the list that will be passed to the 5th call of the Mergesort algorithm.
Among Selection Sort, Insertion Sort, Mergesort, Quicksort, and Heapsort, which algorithm would you choose for the situation below? Only pick one algorithm.The simplicity of implementation should also be considered AFTER the consideration of speed, the number of assignment operation and the extra space requirement. Use the chart below for your considerations.
A) The list has several hundred records. The records are quite long, but the keys are very short.
B) The list has about 25,000 records. It is desirable to complete the sort as quickly as possible on the average, but it is also critical that the sort be completed quickly in every single case.
C) The list has about 45,000 records, but it starts off only slightly out of order.
Chapter 12 Solutions
Computer Science: An Overview (13th Edition) (What's New in Computer Science)
Ch. 12.1 - Prob. 1QECh. 12.1 - Prob. 2QECh. 12.1 - Prob. 3QECh. 12.1 - Prob. 4QECh. 12.2 - Prob. 1QECh. 12.2 - Prob. 2QECh. 12.2 - Prob. 3QECh. 12.2 - Prob. 4QECh. 12.2 - Prob. 5QECh. 12.3 - Prob. 1QE
Ch. 12.3 - Prob. 3QECh. 12.3 - Prob. 5QECh. 12.3 - Prob. 6QECh. 12.4 - Prob. 1QECh. 12.4 - Prob. 2QECh. 12.4 - Prob. 3QECh. 12.5 - Prob. 1QECh. 12.5 - Prob. 2QECh. 12.5 - Prob. 4QECh. 12.5 - Prob. 5QECh. 12.6 - Prob. 1QECh. 12.6 - Prob. 2QECh. 12.6 - Prob. 3QECh. 12.6 - Prob. 4QECh. 12 - Prob. 1CRPCh. 12 - Prob. 2CRPCh. 12 - Prob. 3CRPCh. 12 - In each of the following cases, write a program...Ch. 12 - Prob. 5CRPCh. 12 - Describe the function computed by the following...Ch. 12 - Describe the function computed by the following...Ch. 12 - Write a Bare Bones program that computes the...Ch. 12 - Prob. 9CRPCh. 12 - In this chapter we saw how the statement copy...Ch. 12 - Prob. 11CRPCh. 12 - Prob. 12CRPCh. 12 - Prob. 13CRPCh. 12 - Prob. 14CRPCh. 12 - Prob. 15CRPCh. 12 - Prob. 16CRPCh. 12 - Prob. 17CRPCh. 12 - Prob. 18CRPCh. 12 - Prob. 19CRPCh. 12 - Analyze the validity of the following pair of...Ch. 12 - Analyze the validity of the statement The cook on...Ch. 12 - Suppose you were in a country where each person...Ch. 12 - Prob. 23CRPCh. 12 - Prob. 24CRPCh. 12 - Suppose you needed to find out if anyone in a...Ch. 12 - Prob. 26CRPCh. 12 - Prob. 27CRPCh. 12 - Prob. 28CRPCh. 12 - Prob. 29CRPCh. 12 - Prob. 30CRPCh. 12 - Prob. 31CRPCh. 12 - Suppose a lottery is based on correctly picking...Ch. 12 - Is the following algorithm deterministic? Explain...Ch. 12 - Prob. 34CRPCh. 12 - Prob. 35CRPCh. 12 - Does the following algorithm have a polynomial or...Ch. 12 - Prob. 37CRPCh. 12 - Summarize the distinction between stating that a...Ch. 12 - Prob. 39CRPCh. 12 - Prob. 40CRPCh. 12 - Prob. 41CRPCh. 12 - Prob. 42CRPCh. 12 - Prob. 43CRPCh. 12 - Prob. 44CRPCh. 12 - Prob. 46CRPCh. 12 - Prob. 48CRPCh. 12 - Prob. 49CRPCh. 12 - Prob. 50CRPCh. 12 - Prob. 51CRPCh. 12 - Prob. 52CRPCh. 12 - Prob. 1SICh. 12 - Prob. 2SICh. 12 - Prob. 3SICh. 12 - Prob. 4SICh. 12 - Prob. 5SICh. 12 - Prob. 6SICh. 12 - Prob. 7SICh. 12 - Prob. 8SI
Knowledge Booster
Similar questions
- Why is it necessary to read two sorted lists at the same time when using a binary search and ranking based algorithm to merge them?arrow_forwardWrite the merge sort algorithm. Sort the following elements using merge sort in alphabetical order by clearly showing the steps involved. M, E, R, G, E, S, O, R, T, I, S, E, A, S, Yarrow_forwardIf the list has the following items 17 9 11 30 8 20 35 7 5 45 3 28 Apply the quick sort on the above list by using the pivot is always the left item and if The list after a first partition call is 7 9 11 3 8 5 17 20 35 40 30 28 (17 is the pivot correct position) , find The split point in the second partition call?arrow_forward
- Why is it necessary to read two sorted lists simultaneously when combining them using a binary search and ranking algorithm?arrow_forwardThe running time of Merge, which is part of Merge Sort, is O(arrow_forwardQuick Sort is used for the majority of the standard sorting functions.Why is QuickSort the recommended algorithm while MergeSort has a better/predictable run time?arrow_forward
- Sort the same list of numbers using the merge sort: (no code, just handwritten showing of sorted steps)13 9 5 7 12 2 3 14 6 1arrow_forwardSort the following list using the Selection Sort algorithm . Show the list after each iteration of the outer for loop (after each complete pass through the list) IMPORTANT: Separate each value by a comma and only one space after each comma and no space after the last value. You will have seven iterations of the list for your answer. 38, 60, 43, 5, 70, 58, 15, 10arrow_forwardIf the list has the following items 17 9 11 30 8 20 35 7 5 45 3 28 Apply the quick sort on the above list by using the pivot is always the left item and find the following The list after a first partition call 2-The split point in the second partition callarrow_forward
- 3. Use the bubble sort to sort f, c, v, b, n, x, showing the lists obtained at each step. Justify your answer using pseudocode in every step.arrow_forward4- Sort the list A[]={ 20, 13,4, 34, 5, 15, 90, 100, 75, 102, 112, 1} a) Using Merge Sort and show the order that the Merge procedure is performed. b) Explain the average case of Merge Sort. Give a detail explanation of how we can estimate the mean in relationship with the worst and best-case scenarios (hint: use the answer for question 3 as a lower-bound for the average).arrow_forwardYou're seeking for an item inside a 450,000-item sorted list (the equivalent of Webster's Third New International Dictionary). How many steps would a sequential search need to locate the item? Is this a binary search?arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education