Recursive Function and Merge Sort - Computer Science Assignment Help

Download Solution Order New Solution

Assignment Task

 

Question 1
Write a class with methods for each of the below. Test your methods from the main method.
Write a recursive function that prints a given positive integer value as its binary equivalent. For example, if the value is 11 the output should be 1011.
Given below is a recursive function sum(a,b) that calculates the summation of the numbers:   a + (a+1) + (a+2) +  .. + b. Write a tail recursive function that provides the same functionality.
 

Question 2
MergeSort continuously divides the data into segments until segments of size 1 are reached. It then begins the merging phase. This is the expensive part. Improvements could be made if we could reduce the cost of merging. It turns out that InsertionSort is very efficient for small data sequences (say sequences of 32 or 64 values) where the data is partially ordered in the correct order and the displacement is small.
The idea is to combine MergeSort & InsertionSort to reduce the overhead of merging. To do this we terminate the MergeSort when segments of a given size are reached (here we will use array length is <= 100) & use InsertionSort to sort the segments and then do the merging as before.
You will be given some skeleton code (Question2.java) which will create and test your mergeInsertSort using the following various arrays:

 

 

This Computer Science Assignment has been solved by our Computer Science experts at My Uni Paper. Our Assignment Writing Experts are efficient to provide a fresh solution to this question. We are serving more than 10000+ Students in Australia, UK & US by helping them to score HD in their academics. Our Experts are well trained to follow all marking rubrics & referencing style.
Be it a used or new solution, the quality of the work submitted by our assignment experts remains unhampered. You may continue to expect the same or even better quality with the used and new assignment solution files respectively. There’s one thing to be noticed that you could choose one between the two and acquire an HD either way. You could choose a new assignment solution file to get yourself an exclusive, plagiarism (with free Turnitin file), expert quality assignment or order an old solution file that was considered worthy of the highest distinctio.

Get It Done! Today

Country
Applicable Time Zone is AEST [Sydney, NSW] (GMT+11)
+

Every Assignment. Every Solution. Instantly. Deadline Ahead? Grab Your Sample Now.