You made it easily understandable with the help of clearly drawing example...Thanks!
@souravdebnathx3 жыл бұрын
best easy explaination ever i searched!
@nikoo283 жыл бұрын
Glad I could help you out :)
@vikasvarma94622 ай бұрын
best sir jii very good explanations ❤❤
@satyamgupta6030 Жыл бұрын
great explaination bhaiya keep making such awesome videos for us.
@nikoo28 Жыл бұрын
so glad you liked it
@gokulnaathb26278 ай бұрын
Super approach!
@taniyasharma89243 ай бұрын
Hey, this is giving time limit exceeded on leetcode.. can you please help
@ganeshjaggineni4097 Жыл бұрын
NICE SUPER EXCELLENT MOTIVATED
@zewdih387111 ай бұрын
Excellent Explanation
@nikoo2810 ай бұрын
Glad it was helpful!
@ellase87473 жыл бұрын
Hi, thank you so much for this explanation. Why the variable headNode never used?
@nikoo283 жыл бұрын
We need a starting point when creating a new list. This headnode acts as a sentinel node which is used for temporary purpose and such that we don’t lose track of the starting point.
@zack176 Жыл бұрын
@@nikoo28is this python language
@priyanshgarg1292 Жыл бұрын
no java@@zack176
@somsaichowdhary861 Жыл бұрын
great explaination bhaiya
@ekacaesium729 ай бұрын
this was the best man .....
@preetijavali65958 ай бұрын
Hi Thanks again for the video. The part where appending remaining list if any one ofthem reach to null, doesn't that code become unreachable?
@nikoo288 ай бұрын
no, because you are running the first loop only until one of the list reaches null. So it could be possible that l2 reaches null first, while not l1 Then you will jump at the lower portion of code.
@ashok20893 ай бұрын
Nikhil, Can you please do a video on Merge K Sorted List?
@nikoo283 ай бұрын
Yes, I plan to do it, it will be very similar to this approach though
@ashok20893 ай бұрын
@@nikoo28 Thank you!
@SOURAV-tu5jw3 жыл бұрын
Thanks. Keep doing the good work
@BhavanaHemaSree Жыл бұрын
sir but we are creating a new list doesn't it consumes extra space
@nikoo28 Жыл бұрын
we are not creating a new list, we are just assigning pointers. This is the beauty of a linked list. :) Watch my theoretical videos on linked lists for a better understanding.
@robinsingh202 Жыл бұрын
NIcely Done!
@subee12810 ай бұрын
Thanks
@souravdebnathx3 жыл бұрын
thanks brother!!
@everyontech2716 Жыл бұрын
great job
@rakshan425311 ай бұрын
Just my doubt if anyone can clear will be really helpful , why headNode is never used but at last headNode is returned? it will be having the sorted list??
@nikoo2810 ай бұрын
Because we are playing with pointers. Watch my introductory videos on linked lists for a better understanding :)
@KothapalliKeerthi Жыл бұрын
Sir, could you please do lectures on Python data structures
returnNode = returnNode.next code line is not explained. Can you please.
@nikoo283 жыл бұрын
That is because the initial node we created was a temporary node. So that we have something to start building. The actual merged list starts from the next node. Hence we return the next.
@swetaswarnakar8282 жыл бұрын
@@nikoo28 how is it constant space? are not we storing them in returnNode? so it should be O(n + m) space and time also???
@sarthakgupta0969 ай бұрын
Bhaiya thanku 😊
@midhuns29343 жыл бұрын
Why are we assigning the dummy node to another node??
@nikoo283 жыл бұрын
We need a starting point for our result. This dummy node serves the purpose.
@vaishnevprabu64745 ай бұрын
It results in a runtime error
@gurunathkulkarni6397 Жыл бұрын
Sir, it is saying time limit exceeded
@aashushaikh5843 Жыл бұрын
yes and also it s giving : java.lang.NullPointerException: Cannot read field "val" because "" is null this error can u tell. me why?:
@nikoo28 Жыл бұрын
did you check out the code on github given in the video description?
@trader184 Жыл бұрын
What is the last line tell me🤧🤧🤧🤧🤬
@anshukumarchoudhary38332 жыл бұрын
man why have u made this video when u did not explain each line.
@nikoo28052 жыл бұрын
Which part are you facing a problem at? I can help you out further.