Computer Science, asked by viju704, 10 months ago

Given an integer array of which both first half and second half are sorted. The task is to merge two sorted halves of the array into a single sorted array.

Answers

Answered by PiyushSinghRajput1
2

Sort an array when two halves are sorted

Given an integer array of which both first half and second half are sorted. Task is to merge two sorted halves of array into single sorted array.

Examples:

Input : A[] = { 2, 3, 8, -1, 7, 10 }

Output : -1, 2, 3, 7, 8, 10

Input : A[] = {-4, 6, 9, -1, 3 }

Output : -4, -1, 3, 6, 9

Answered by Anonymous
1

Answer:

An integer array of the juth first half are stored fir the task to storage the halves the array

Similar questions