Find the optimum value of k and compare the result

Assignment Help Data Structure & Algorithms
Reference no: EM132106248

Processing time of InsertionSort is c · n2. To merge k pre-sorted subarrays that contain together n items you have to compare the k top items in all the sub- arrays to choose the current maximum item and place it into the sorted array (assuming that all the items have to be sorted in ascending order).

Therefore, the time for merging is proportional to (k - 1) · n.

Let the processing time of the merge be c · (k - 1) · n where the scale factor has the same value as for InsertionSort. Analyse whether it is possible to accelerate sorting of n items in the following way:

-Split the initial array of size n into k subarrays of size n/k. The last subarray may be longer to preserve the total number of items n but do not go in such details in your analysis.

-Sort each subarray separately by InsertionSort.

-Merge the sorted subarrays into a final sorted array.

If you have found that the acceleration is possible, then find the optimum value of k and compare the resulting time complexity of this sorting algorithm to that of InsertionSort and MergeSort.

 

Reference no: EM132106248

Questions Cloud

What aspect of adolescent thinking is danica experiencing : Danica woke up and had a pimple on her cheek. She pretended to be sick so she didn't have to go to school because she was sure everyone was going to see
What psychological phenomenon does filter theory help : What psychological phenomenon does filter theory help explain ? give a real-life example of the kind of stimuli that are allowed through the filte
How does the processor know which function to execute : What is the only place, other than the function definition,that the name of the function used as the service routine is given in the source code of your project
Amount of hormone the fetus : Do you believe some of the differences we see are differences in the amount of hormone the fetus is exposed
Find the optimum value of k and compare the result : The last subarray may be longer to preserve the total number of items n but do not go in such details in your analysis.
Clear threat of violence towards someone : What are some points that should be considered if a client makes a clear threat of violence towards someone?
What is the ethical issue described in the scenario : Question: What is the ethical issue described in the scenario? Why is this an ethical issue?
Does professor amongus deserve the turing award : Professor Amongus has just designed an algorithm that can take any graph G with n vertices and determine in O(nk)time whether G contains a clique of size k.
Discuss the specific therapy : Choose ONE of the disorders and discuss the specific therapy (i.e., Cognitive Behavioral Therapy, Psychoanalysis, etc.) that you think may work best in treating

Reviews

Write a Review

Data Structure & Algorithms Questions & Answers

  Implement an open hash table

In this programming assignment you will implement an open hash table and compare the performance of four hash functions using various prime table sizes.

  Use a search tree to find the solution

Explain how will use a search tree to find the solution.

  How to access virtualised applications through unicore

How to access virtualised applications through UNICORE

  Recursive tree algorithms

Write a recursive function to determine if a binary tree is a binary search tree.

  Determine the mean salary as well as the number of salaries

Determine the mean salary as well as the number of salaries.

  Currency conversion development

Currency Conversion Development

  Cloud computing assignment

WSDL service that receives a request for a stock market quote and returns the quote

  Design a gui and implement tic tac toe game in java

Design a GUI and implement Tic Tac Toe game in java

  Recursive implementation of euclids algorithm

Write a recursive implementation of Euclid's algorithm for finding the greatest common divisor (GCD) of two integers

  Data structures for a single algorithm

Data structures for a single algorithm

  Write the selection sort algorithm

Write the selection sort algorithm

  Design of sample and hold amplifiers for 100 msps by using n

The report is divided into four main parts. The introduction about sample, hold amplifier and design, bootstrap switch design followed by simulation results.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd