Recent questions tagged merging

1.1k
views
2 answers
12 votes
Given an unsorted array of $n$ distinct elements, you want to find this set of $\log n$ elements: those at positions $1,2,4,8,16, \ldots, n/2$ if array were sorted. In ... \Theta(\log n)$\Theta(n)$\Theta(n \log n)$\Theta\left(n^{2}\right)$
1.0k
views
1 answers
0 votes
DSA
Given two max heap, one of size n and other m. Calculate the time complexity of merging them to get a max heap.
323
views
1 answers
5 votes
Consider the following pseudo-code of function fun(). fun() takes k arrays as input and return merged array of all. Assume that merge function takes $O(p+q)$ where $p$ is length of first ... $T(k)=O(n \log nk )$
1.1k
views
0 answers
0 votes
Can anyone help me to understand this problem….??
529
views
1 answers
0 votes
What is the minimum and maximum number of comparisons required to merge two lists of size m and n ?
1.8k
views
1 answers
3 votes
How many swaps are performed in Merge sort algorithm in worst case?
1.7k
views
2 answers
0 votes
The total number of comparions required to merge 4 sorted files containing 15, 3, 9 and 8 records into a single sorted file is A.66 B.39 C.15 D.33
1.6k
views
3 answers
0 votes
A list of n string, each of length n, is sorted into lexicographic order using the merge-sort algorithm. The worst case running time of this computation is(A) (B) (C) (D)
18.4k
views
2 answers
3 votes
The average no. of comparisons performed by the merge sort algorithm, in merging two sorted lists of length 2 is -a) 8/3b) 8/5c) 11/7d) 11/6
631
views
2 answers
0 votes
4.0k
views
1 answers
2 votes
Given a set of sorted files f1,f2,f3,f4,f5 of lengths 99,27,71,199,259 we need to merge these files into a single sorted file Using Optimal Merge Pattern.
1.5k
views
2 answers
2 votes
To merge 2 files of size m and n it takes m + n time What will be the optimal time Complexity to merge the files of size 10, 15, 40, 70, 75 and 80?
3.7k
views
4 answers
2 votes
Suppose there are 4 sorted lists of 8 elements each. If we merge these lists into a single sorted list of 32 elements. The key comparisons that are needed in the worst case using an efficient algorithm are ____.
328
views
0 answers
0 votes
696
views
0 answers
0 votes
Can anyone clarify hy they are getting 269 and and I am getting 258?
2.1k
views
4 answers
2 votes
The optimal time required in merging the list of size 11, 21, 33, 34,45,54,60 ismy answer (11+21)*4+ 33*3 +(34+45)*3 + (54+60)*2but the provided ... think I have solved it wrong but just want to confirm is there any other way to do this?
312
views
1 answers
0 votes
433
views
1 answers
0 votes
Let $F_1,F_2,..............F_n$ be files with length $L_1,L_2........L_n$ we would like to merge all of the files together to make a single file .The cost ... of merging ten files whose length are $5,3,10,20,15,10,5,1,2,4$ is _____________.
314
views
1 answers
0 votes
Number of comparisions in worst case required to merge two sorted arrays of size 40 and 60 are-------
11.8k
views
2 answers
0 votes
If I have two lists of length 2 then no of comparisons in the worst case would be 2 only , since If I have say 10,20 in list A and 5,7 in list B ... have merged both the lists , so then how to calculate the average no of comparisons here ?
48.5k
views
6 answers
35 votes
For merging two sorted lists of sizes $m$ and $n$ into a sorted list of size $m+n$, we require comparisons of$O(m)$O(n)$O(m+n)$O(\log m + \log n)$
25.6k
views
8 answers
86 votes
Suppose $P, Q, R, S, T$ are sorted sequences having lengths $20, 24, 30, 35, 50$ respectively. They are to be merged into a single sequence by ... that will be needed in the worst case by the optimal algorithm for doing this is ____.
To see more, click for the full list of questions or popular tags.