Computer Science · Algorithms
What does the following merge sort merge step return for left = [1, 3] and right = [2, 4]? i = 0, j = 0 result = [] while i < len(left) and j < len(right): if left[i] <= right[j]: result.append(left[i]); i += 1 else: result.append(right[j]); j += 1 while i < len(left): result.append(left[i]); i += 1 while j < len(right): result.append(right[j]); j += 1 return result
- 1[1, 2, 4, 3]
- 2[2, 4, 1, 3]
- 3[1, 3, 2, 4]
- 4[1, 2, 3, 4]✓
Correct answer
[1, 2, 3, 4]
Download Single Question PDF
Save this question and verified answer as a clean study sheet with live clickable link.
Share with Friends & Study Groups
Challenge your peer aspirants on WhatsApp or Telegram to solve this question!
Preparing for Computer Science?
Practice full-length mock tests with real exam timers, instant score analysis, and all-India ranking.
Want more practice questions on Algorithms?
Solve complete topic-wise tests with detailed solutions on GkGet.
Related Practice Questions
Recommended practice questions in Computer Science · Algorithms