Question: NEED HELP WITH MATLAB CODE Consider a vector, a, of length 8. Write the code for sorting a using merge-sort. Test your algorithm with various

NEED HELP WITH MATLAB CODE

Consider a vector, a, of length 8. Write the code for sorting a using merge-sort. Test your algorithm with various possible inputs for a to make sure the algorithm works correctly (has no bugs) for a specific vector, a

Your script needs to call a function that will input the vector, a, into your script.

The vector will be in a function called : a = myvector()

Here is an example what myvector will look like

function [ a ] = myvector()

% This function simply contains a vector

% that I will use to test your merge sort algorithm

a = [ 2 5 7 3 4 6 9 4 ];

end

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!