У нас вы можете посмотреть бесплатно Commonly asked Interview Question- Merge Two Sorted Arrays(With and without extra space) или скачать в максимальном доступном качестве, видео которое было загружено на ютуб. Для загрузки выберите вариант из формы ниже:
Если кнопки скачивания не
загрузились
НАЖМИТЕ ЗДЕСЬ или обновите страницу
Если возникают проблемы со скачиванием видео, пожалуйста напишите в поддержку по адресу внизу
страницы.
Спасибо за использование сервиса ClipSaver.ru
Merge Two Sorted Arrays is an important interview question asked in companies like Microsoft, Adobe, Google, Amazon, Goldman Sachs, Apple, Facebook, IBM, Oracle, etc. Topic - Arrays, Sorting Question- In this problem, we are given two sorted arrays of size N+M and M respectively. The task is to merge the arrays into one single array without extra space. Logic - 1. The arr1 is of size N+M and arr2 is of size M, let variable k = N+M-1, i=n-1, and j=m-1. 2. The idea is to follow the same approach as the Merge process of Merge Sort. a. Compare arr1[i] and arr2[j], until i and j are greater then equal to 0 i. if arr1[i] is greater then arr2[j], then in arr1[k] insert arr1[i] ii. else in arr1[k] insert arr2[j] b. If i is not zero then copy arr1[i] in arr1[k] till i becomes 0. c. If j is not zero then copy arr2[j] in arr1[k] till j becomes 0. Become an expert coder and get your Dream Job - https://bit.ly/3oZCT9U Get video solutions of Top 100 interview questions - https://bit.ly/3uz8LmO Follow Instagram for more coding questions: / prepbytes Facebook: / prepbytes0211