Computer Science: An Overview (12th Edition)
12th Edition
ISBN: 9780133760064
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
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.
4- 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).
Apply Merge sort and Quick to sort the list, C, O,M,P,I,L,O,R in alphabetical order?
Chapter 12 Solutions
Computer Science: An Overview (12th Edition)
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
- A list is given an = {6,2,-4,13,7} Answer the following questions. a. What is n in an? b. List all the steps of sorting this list using insertion sort. c. What is the output of this search? And what does it indicate?arrow_forwardsolve this problem using pythonarrow_forwardSuppose you were to sort a list of values using mergesort. Give the asymptotic tight bound for the total number of recursive calls to mergesort that the algorithm would make? Explain the reasoning behind your answer.arrow_forward
- Please explain in as much detail as possible. Within one paragraph. It’s possible to ensure that an insertion sort implementation runs in linear time on a list that’s already sorted. How?arrow_forwardQuestion 11 An algorithm will be used to identify the maximum value in a list of one or more integers. Consider the two versions of the algorithm below. Algorithm I: Set the value of a variable max to - 1. Iterate through the list of integer values. If a data value is greater than the value of the variable max, set max to the data value. Algorithm II : Set the value of a variable max to the first data value. Iterate through the remaining values in the list of integers. If a data value is greater than the value of the variable max, set max to the data value. Which of the following statements best describes the behavior of the two algorithms? A Both algorithms work correctly on all input values. В Algorithm I always works correctly, but Algorithm II only works correctly when the maximum value is not the first value in the list. Algorithm Il always works correctly, but Algorithm I only works correctly when the maximum value is greater than or equal to - 1. D Neither algorithm will…arrow_forwardArrange the given integer values in increasing order by applying step by step quicksort algorithm with following conditions: (a) Always choose first element of the list as pivot. (b) Do not assume infinity or maximum element at the end of the list during sorting. Given Data: 15, 11, 13, 14, 10, 8, 7, 9, 3, 5 (Initially, Pivot=15).arrow_forward
- Merge Sort Algorithm to remove duplicates from a text list. Show Complexity Analysis. Example, [Mike,Keya,Mike,John] -> [Mike,Keya,John] The order doesn't matter.arrow_forwardPlease explain answer in detailarrow_forwardSuppose you have a sitting arrangement of the students who will give the final exam in a list. The list contains the last two digits of their student ID as given below. [10,30,20,70,11,15,22,16,58,100,12,56,70,80] Now you want to organize the sitting arrangement of the students in your own way. You decide to sort all the students in the even indices of the list in ascending order and all the students in the odd indices of the list in descending order. So, write a python program that organizes the list for you in this way. [You cannot use python build-in sort() function, you can call your own sort function or copy your code from previous tasks instead] =============================================================== Output: [10, 100, 11, 80, 12, 70, 20, 56, 22, 30, 58, 16, 70, 15] def task4(list_in): # YOUR CODE HERE return list_out * please use list_in andreturn list _out also no sort() function, thank you so much for your helparrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Programming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:Cengage
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage