Recent questions tagged merge-sort

228
views
0 answers
0 votes
Calculate the minimum and maximum number of element comparisons involved in 2 way merge sort assuming n is power of 2.
713
views
2 answers
2 votes
Consider the following array$: [32, 33, 5, 2, 14, -4, 22, 39, 34, -9].$ We apply a certain sorting algorithm and observe that the ... applied?Merge sort (top-down approach)Bubble sortQuicksort (Using First element as pivot)Insertion sort
889
views
1 answers
4 votes
Professor Fiorina uses the following algorithm to merge $k$ sorted lists, each containing $n / k$ elements.She takes the first list and merges it with the second list using a ... $\theta(k \log n)$
460
views
1 answers
3 votes
Here is an array of ten integers$: 5389170264$Suppose we run MergeSort on this array. What is the number in the $7$th position of the partially sorted array after the outermost two ... $ in its $7$th position.)$3$1$2$4$
1.0k
views
1 answers
1 votes
Which of the following statement(s) is/are true?(a) Quicksort and merge sort are both examples of divide and conquer algorithms.(b) If we randomly choose a pivot ... worst case complexity $O(n log n)$.plese give answer and explain it why ?
350
views
1 answers
2 votes
Which of the following is/are TRUE?In the worst case, merge sort runs in $O\left(n^2\right)$ time.Depth-first search of a graph is asymptotically faster than ... a binary search tree leaves the same tree as inserting $y$ and then $x$.
1.5k
views
1 answers
7 votes
A list of $n$ arrays, each of length $n$, is passed to an algorithm like merge-sort. The algorithm recursively divides a set of arrays into two parts until there are only two arrays.If ... 2 T(n / 2)+n$T(n)=2 T(n / 2)+n^ 3$None of these
919
views
1 answers
2 votes
Suppose we do merge sort with a three-way split: divide the array into 3 equal parts, sort each part and do a 3 way merge.What would the worst-case complexity of this version be? O($n^2$)O($n^2$ log3n)O(n log2n)O(n $(log2n)^2$)
490
views
0 answers
0 votes
External Merge Sort is necessary when you cannot store all the data into memory. The best you can do is break the data into sorted runs and merge the runs in ... a file of 105 pages. The cost of sorting using m-way merge sort is__ ?
1.7k
views
5 answers
6 votes
Merge sort uses :Divide-and-conquerBacktrackingHeuristic approachGreedy approach
1.9k
views
5 answers
5 votes
Given two sorted list of size '$m$' and '$n$' respectively. The number of comparisons needed in the worst case by the merge sort algorithm will be :$m^{*}n$minimum of $m, n$maximum of $m, n$m+n-1$
623
views
0 answers
0 votes
Rewrite the MERGE procedure so that it does not use sentinels, instead of stopping once either array $L$ or $R$ has had all its elements copied back to $A$ and then copying the remainder of the other array back into $A$.
1.8k
views
1 answers
1 votes
Using Figure $2.4$ as a model, illustrate the operation of merge sort on the array $A=\langle 3,41,52,26,38,57,9,49 \rangle $
4.1k
views
4 answers
1 votes
In Merge sort Algorithm when I took input array of size 2 and I got 4 function calls as including original function call with which I call MS algorithm i.e ... analyze the total number of function calls when input array size is n?thank you!
997
views
1 answers
0 votes
Find the total number of comparisons if merge sort is used. Explain with proper steps.2, 5, 8, 4, 1, 7, 6, 3Total no of comparison.
733
views
0 answers
0 votes
What is the extra memory needed for merge sort:1] In case of Iterative merge sort.(DS:Array)2]In case of Recursive merge sort.(DS:Array)3] In case of Iterative merge sort.(DS:Linked List)4]In case of Recursive merge sort.(DS:Linked List)
731
views
1 answers
1 votes
The average no. of comparisons performed by the merge sort algorithm, in merging 2 sorted lists of length 2 is___________.Ans: $\frac{8}{3}$