Merge 2 array without extra space || Hard || Geeksforgeeks

preview_player
Показать описание
Description
Given two sorted arrays arr1[] of size N and arr2[] of size M. Each array is sorted in non-decreasing order. Merge the two arrays into one sorted array in non-decreasing order without using any extra space.

Link

***********************************************************
And for more free courses and placement related stuffs join our telegram channel

CS and IT students preparing for placements.
GATE exam
College exam
Interview
More videos coming soon...
#CompetitiveProgramming
#Geeksforgeeks
#Amazon
#Flipkart
#Adobe
#Codechef
#leetcode
#Hackerrank
#placement2021
#BeautyWithCodes

Рекомендации по теме
Комментарии
Автор

madam question etna bhi easy nhi tha jitna apka video dekhne pr lgne you missed a very important point that is sort() funtion uses O(n) space to sort the array. if you know any other solution please let me know.
by the way, thank you if you would reply :)

SunilKumar-wbys
Автор

Sorting uses space internally, so the solution isn't O(1) SC!

ritambanerjee
Автор

if you do this solution in O(1) space then not do the last step

tanmaysatsangi
Автор

Intuition toh btayi hi nhi Di aapne, bas aap sidha solution bta diya!!

shankar
Автор

Super Excellent explanation in a very easy way.

tanmaysatsangi
Автор

Really after watching your session, I lost my basic understanding of what I know before that....sorry

vivekmit
Автор

Seriously yaar ... Last 1 hour se 7-8 videos dekh chuka tha .. sab ke sab shell sort, gap method issi se krre the ... And your method is so simple ... 5 min mei hogya ... Well deserve a like 👍👍

K-CO-Muzzmil
Автор

How the f*ck is this a O(1) extra space algorithm??? It is futile to create a new array for storing the result, which in turn breaks the "O(1) space complexity"

swapnilghosh
Автор

mam can you kindly explain the best optimal approach that is using gap algorithm?

bikramjitdas
Автор

can u please explain, how these algorithm works on given two array: arr1 = [1, 3, 5, 7] & arr2 = [0, 2, 6, 8, 9]. On my side it is not working. If you solve the array by using that(explained in video)algorithm then it is very very helpful for me.

tanmaysatsangi
Автор

Thanks a lot ma'am. According to me this explanation is the best ever explanation on you tube.

imranwahid
Автор

you can merge two for loops at the end and push sequentially using while that will be also good

ayaskanta
Автор

you have to sort the array without extra space.

nikhilpatil
Автор

u havent discussed and coded the most optimal approach (gap algorithm) this is only better and not optimal

atharvakulkarni
Автор

Trust me your channel is very underrated....I was stuck in this question for hours and after watching half of your video I solved it in less than 10 Thanks and please keep uploading these types of tricky problems🤩

alphonseprakash
Автор

Best explanation ever 🔥thanks a lot Didi ❤️

arijitmohapatra
Автор

Mam i dont think this is 0(1) space.. pls correct me if i am wrong

HIMANSHUSHARMA-zosg
Автор

It will not take O (1) extra space. You are taking extra 1D array to store the result which will take O (n) extra space. Plz optimize it.

saketdixit
Автор

Extra space nhi use krna tha aur apne kr liya
It's wrong solution.

RahulVerma-ylbd
Автор

intro ky tatti tha btw beauty mai koi koi nhi hai

surajroy
visit shbcf.ru