➡ Download my DSA with JS E-Book - topmate.io/roadsidecoder/491565 👤 Join the RoadsideCoder Community Discord - discord.gg/2ecgDwx5EE 🟪 Follow me on Instagram and u will clear your interview 🤓 - instagram.com/roadsidecoder/
Great video as always, but I'm confused about why the time complexity of the merge function comes out to be O(n). Since we are doing a shift operation inside the while loop, won't it be O(n^2)? Imagine while loop running for n times (it'll run for x times, where x is the minimum of the lengths of 2 arrays that we are merging), and then for each of that iteration, along with a simple push operation (which completes in O(1), we are also doing two shifts, which are completed in O(n)), so won't the complexity of the merge function turn out to be O(n^2) with this approach?
Ok ,I will check ,As you said this sheet is for front end developers As you know the most happening library in F.E is React Js so people like me mostly expect most asked meta F.E interview questions included completely in this DSA sheet
➡ Download my DSA with JS E-Book - topmate.io/roadsidecoder/491565
👤 Join the RoadsideCoder Community Discord - discord.gg/2ecgDwx5EE
🟪 Follow me on Instagram and u will clear your interview 🤓 - instagram.com/roadsidecoder/
Agayaaa video 🎉🎉🎉🎉
I have followed you for a very long time and I have learn't a lot
I really like the content u producing here. It makes your channel unique keep up with the good work for us
Great video as always, but I'm confused about why the time complexity of the merge function comes out to be O(n). Since we are doing a shift operation inside the while loop, won't it be O(n^2)? Imagine while loop running for n times (it'll run for x times, where x is the minimum of the lengths of 2 arrays that we are merging), and then for each of that iteration, along with a simple push operation (which completes in O(1), we are also doing two shifts, which are completed in O(n)), so won't the complexity of the merge function turn out to be O(n^2) with this approach?
Hi @RoadsideCoder, you must subtract 1 from the mid after getting floor value as the array index starts from 0. Thanks.
yeah thats true , slice () function is doing the work here 🙂
EAGERLY Waiting for the video on
Classes
Design Patterns
And interview questions on above.
you should have dry run it once
Hey Piyush, I downloaded your E-book but I am unable to open it, I don't know what is the file type, but it's not getting opened.
Please contact me on instagram @roadsidecoder
Plz let us know whether your DSA sheet contains the answers as well or not
I have explained how to find answers with multiple different approach if u get stuck
Ok ,I will check ,As you said this sheet is for front end developers As you know the most happening library in F.E is React Js so people like me mostly expect most asked meta F.E interview questions included completely in this DSA sheet
bro you should not use inbuilt functions for interviews
😍🚀