Professional Documents
Culture Documents
Write Down C++ Code For Merge Sort Algorithm. The ...
Write Down C++ Code For Merge Sort Algorithm. The ...
home / study / engineering / computer science / computer science questions and answers / write...
Find solutions for your homework
Write down C++ code for Merge Sort Algorithm. The algorithm should sort the data
in ascending order. The input data should of size 8. Once a program starts, user should be provided
an option to input the data randomly. Once the sorting operation is completed the output should be
displayed along with the number of computations it took to complete the whole sorting process.
1 Comment
Expert Answer
Anonymous
answered this
/******************************************************************************
*******************************************************************************/
#include <iostream>
using namespace std;
int c=0;
void merge(int arr[], int start, int mid, int end) {
int i, j, k;
i = 0;
j = 0;
k = start;
for variable lenth of array, you can introduce vector in the code [here I am using xed lenth for the array
(i.e. 10)].
0 Comments
0
Up next for you in Computer Science
Write a program to merge two sorted arrays into a third array. Ask the user to enter the size of the two
arrays. The length of array1 could be greater than, equal to or less than the length of array2. Fill both
with random numbers 0-99. Sort both arrays as explained below. Write a method merge that takes the
two arrays as arguments. The method returns a merged array with size equal...
See answer
Build an application which populates (Builds) BST and then saves all nodes data into a le data.dat by
using object IO. Each node should have following data Patient Name Father Name Age NIC(Numeric)
Address Disease Doctor Name Patient ID(Numeric). NIC and patient ID should be unique. Choice should
be given to the user either build BST on basis of NIC or Patient ID.
See answer 100% (1 rating)
Show more
COMPANY
CHEGG NETWORK
CUSTOMER SERVICE