32 votes 32 votes You have $n$ lists, each consisting of $m$ integers sorted in ascending order. Merging these lists into a single sorted list will take time: $O(nm \log m)$ $O(mn \log n)$ $O(m + n)$ $O(mn)$ Algorithms cmi2013 algorithms sorting + – go_editor asked May 23, 2016 • edited Jun 30, 2017 by Silpa go_editor 6.8k views answer comment Share Follow See all 2 Comments See all 2 2 Comments reply Manu Thakur commented Dec 21, 2017 reply Follow Share There are n sorted lists, so there will be $logn$ levels, at each level $mn$ work will be done, Add the costs at each level, Hence the answer will be $O(mnlogn)$ 13 votes 13 votes KUSHAGRA गुप्ता commented Nov 29, 2019 reply Follow Share $Ans:O(nm\ logn)$ 8 votes 8 votes Please log in or register to add a comment.
0 votes 0 votes Answer: soujanyareddy13 answered May 7, 2021 soujanyareddy13 comment Share Follow See all 0 reply Please log in or register to add a comment.