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 9.5, Problem 2QE
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
C#
Scenario: You have a collection of 100 RANDOMIZED integers. Your program has a method called Find, which has one parameter, an integer value to search for. Of the options below, what would be the best strategy to maintain efficiency?
1. Binary Sort
2. Linear Search
3. Sort the Data using a Merge Sort, then use Binary Search
True or false: Merge sort can be implemented using O(1) auxiliary space.
Write the program that allows the user to sort using the Merge Sort and Quick Sort. The program should be able to read in data from a binary file (1000000numbers). The first element of the binary file will be used to tell how many elements to read in. Once all the data has been read in, the program should sort the data. The user should be able to choose which algorithm to use to sort the data. The program should print the time before and after the sort. The last part of the program should prompt the user for a lower and upper bound. These two values should then be used to decide how much and which part of the array will be display. You should test all of the sorts on each of the data files. There are a number of files (10numbers.zip, etc.) of increasing size that you can utilize for testing purposes.
Continue to add a a justification of the difference between the run times of each sort when compared to those you're reported on earlier. Include the screenshots of the…
Chapter 9 Solutions
Computer Science: An Overview (12th Edition)
Ch. 9.1 - Identify two departments in a manufacturing plant...Ch. 9.1 - Prob. 2QECh. 9.1 - Summarize the roles of the application software...Ch. 9.2 - Prob. 1QECh. 9.2 - Prob. 2QECh. 9.2 - Prob. 4QECh. 9.2 - Prob. 5QECh. 9.2 - Prob. 6QECh. 9.3 - Prob. 1QECh. 9.3 - What is a persistent object?
Ch. 9.3 - Identify some classes as well as some of their...Ch. 9.3 - Prob. 4QECh. 9.4 - Prob. 1QECh. 9.4 - Prob. 2QECh. 9.4 - Prob. 3QECh. 9.4 - Prob. 4QECh. 9.4 - Prob. 5QECh. 9.4 - Prob. 6QECh. 9.5 - Prob. 1QECh. 9.5 - Prob. 2QECh. 9.5 - Prob. 3QECh. 9.5 - Prob. 4QECh. 9.5 - Prob. 5QECh. 9.5 - Prob. 6QECh. 9.5 - Prob. 7QECh. 9.6 - Prob. 1QECh. 9.6 - Give an additional example of a pattern that might...Ch. 9.6 - Prob. 3QECh. 9.6 - How does data mining differ from traditional...Ch. 9.7 - Prob. 1QECh. 9.7 - Prob. 2QECh. 9.7 - Prob. 3QECh. 9.7 - Prob. 4QECh. 9 - Prob. 1CRPCh. 9 - Prob. 2CRPCh. 9 - Prob. 3CRPCh. 9 - Prob. 4CRPCh. 9 - Prob. 5CRPCh. 9 - Prob. 6CRPCh. 9 - Prob. 7CRPCh. 9 - Prob. 8CRPCh. 9 - Prob. 9CRPCh. 9 - Prob. 10CRPCh. 9 - Prob. 11CRPCh. 9 - Prob. 12CRPCh. 9 - Using the commands SELECT, PROJECT, and JOIN,...Ch. 9 - Answer Problem 13 using SQL. PROBLEM 13 13. Using...Ch. 9 - Prob. 15CRPCh. 9 - Prob. 16CRPCh. 9 - Prob. 17CRPCh. 9 - Prob. 18CRPCh. 9 - Prob. 19CRPCh. 9 - Empl Id Name Address SSN Job Id Job Title Skill...Ch. 9 - Empl Id Name Address SSN Job Id Job Title Skill...Ch. 9 - Prob. 22CRPCh. 9 - Prob. 23CRPCh. 9 - Prob. 24CRPCh. 9 - Prob. 25CRPCh. 9 - Write a sequence of instructions (using the...Ch. 9 - Prob. 27CRPCh. 9 - Prob. 28CRPCh. 9 - Prob. 29CRPCh. 9 - Prob. 30CRPCh. 9 - Prob. 31CRPCh. 9 - Prob. 32CRPCh. 9 - Prob. 33CRPCh. 9 - Prob. 34CRPCh. 9 - Prob. 35CRPCh. 9 - Prob. 36CRPCh. 9 - Prob. 37CRPCh. 9 - Prob. 38CRPCh. 9 - Prob. 39CRPCh. 9 - Prob. 40CRPCh. 9 - Prob. 41CRPCh. 9 - Prob. 42CRPCh. 9 - Prob. 43CRPCh. 9 - Prob. 44CRPCh. 9 - Prob. 45CRPCh. 9 - Prob. 46CRPCh. 9 - Prob. 47CRPCh. 9 - Prob. 48CRPCh. 9 - Prob. 49CRPCh. 9 - Prob. 50CRPCh. 9 - Prob. 51CRPCh. 9 - Prob. 52CRPCh. 9 - Prob. 53CRPCh. 9 - Prob. 54CRPCh. 9 - Prob. 55CRPCh. 9 - Prob. 56CRPCh. 9 - Prob. 57CRPCh. 9 - Prob. 58CRPCh. 9 - Prob. 59CRPCh. 9 - Prob. 60CRPCh. 9 - Prob. 61CRPCh. 9 - Prob. 62CRPCh. 9 - Prob. 1SICh. 9 - Prob. 2SICh. 9 - Prob. 3SICh. 9 - Prob. 4SICh. 9 - Prob. 5SICh. 9 - Prob. 6SICh. 9 - Prob. 7SICh. 9 - Prob. 8SICh. 9 - Prob. 9SICh. 9 - Prob. 10SI
Knowledge Booster
Similar questions
- homework 1-Sort the list using bubble sort. 96 93 76 84 55 22 2-Sort the list using merge sort. 54 92 75 86 33 11arrow_forwardProgram in Java: topic: insertion sort The state and variable display: Unsorted Partition Reference Index: 7, Traversing Index: 1, Current Traversing Index Value: avocado, Condition Value Index: 0 Current Condition Value: apple, Swapping Condition: FalseCurrent Array: ['apple', 'avocado', 'orange', 'banana', 'strawberry', 'pineapple', 'plum', 'mango'] The Input must be:["apple", "avocado", "orange", "banana", "strawberry", "pineapple", "plum", "mango"]The assumptions and conditions: Sorted partition is on the right side.The order is increasing alphabetically but the strings that has an odd length should be the first to be sorted then the strings with the even length goes next The result or Output must be:['apple', 'avocado', 'mango', 'pineapple', 'banana', 'orange', 'plum', 'strawberry']arrow_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 1.The split point in the second partition call.arrow_forward
- How to create a program that reads data from an input file named bst.txt which contains integers to be inserted to an Integer Binary Search Tree (BST)? After reading the input data the program should do the following: perform breadth-first traversal and display the order in which the nodes are visited perform pre-order depth-first traversal and display the order in which the nodes are visited perform in-order depth-first traversal and display the order in which the nodes are visited perform post-order depth-first traversal and display the order in which the nodes are visited display how many leaves are in the tree what is the height of the tree Put all your file in a folder including the input file and compress the folder using zip format and upload. The folder should contain the following files BSTNode.java BST.java BSTMain.java bst.txt…arrow_forwardHandwriiten solution plzzarrow_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
- The best case behaviour occurs for quick sort when the partition function splits the sequence of size n into subarrays of size: Select one: a.n/4 : 3n/4 b.n/4 : 3n/2 c.3n/8 : (5n/8) d.n/2 : (n/2)-1 e.n/2 : n/3arrow_forwardPerform bubble sort, step by step. These are the set of values to be sorted. 23,37,51,13,84,5,19arrow_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
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