• Courses
  • Tutorials
  • Jobs
  • Practice
  • Contests
July 14, 2023 |2.7K Views
Merge two sorted arrays - SDE Sheet
  Share  1 Like
Description
Discussion

In this video we are given two sorted arrays, the task is to merge them in a sorted manner.

Examples:

Input: arr1[] = { 1, 3, 4, 5}, arr2[] = {2, 4, 6, 8} 
Output: arr3[] = {1, 2, 3, 4, 4, 5, 6, 8}

Input: arr1[] = { 5, 8, 9}, arr2[] = {4, 7, 8} 
Output: arr3[] = {4, 5, 7, 8, 8, 9} 

Try it out before watching the implementation of the problem in the video. We recommend watching the video, even if you can solve the problem. You may discover something new. All the best!!!

Do check out:-

Article: https://www.geeksforgeeks.org/merge-two-sorted-arrays/
Problem: https://practice.geeksforgeeks.org/problems/merge-two-sorted-arrays-1587115620/1
SDE Sheet: https://www.geeksforgeeks.org/sde-sheet-a-complete-guide-for-sde-preparation/

 

Read More