Explanation for the article: www.geeksforgeeks.org/flatteni... This video is contributed by Harshit Jain.
Пікірлер: 31
@HarshaVardhan-jf9sd5 жыл бұрын
Cant get a more dumber explanation of this algorithm...Great job
@divyeshpuri3 жыл бұрын
This dude assumed that the reason I am here is that I didn't know how to read.
@gallilos5 жыл бұрын
sir you should not be a teacher
@caligula21675 жыл бұрын
Thank you for the video. Hey guys. If anyone is struggling with this algorithm, basically what you need to do in order to solve this is: 1) write a function to merge any two sorted lists 2) in the function that you will use for flattening, merge the first two nested lists, then merge the third into your list.and so on, to the end of the argument-list. Regarding the 2), below is the Python-ish pseudo-code that may help clarify the idea (please do let me know of any bugs that could've snuck in): ``` result = head->down node = head->next while node is not nil: result = merge_lists(result, node->down) node = node->next ``` Kind Regards
@bostonlights27494 жыл бұрын
Dude, at least explain the flow with an example. (You could use the example in the question) Otherwise it's just a waste of time.
@hardikpatel-906 жыл бұрын
bekar.. who will explain the code for such a algo??
@Mohit-cn2us4 жыл бұрын
*What's the time complexity for the algorithm ?*
@anirudhdevpura27984 жыл бұрын
Please share the logic and intuition behind the code and then read the code. Expected much better from gfg
@SaurabhYadav-hh7fx4 жыл бұрын
You are just reading the code man!!
@annasbinfazal3406 жыл бұрын
please convert that code in GUI, if is it possible!
@pranaychandra80165 жыл бұрын
Anyone have a solution using min heap or priority queue then please share the link or contribute in any other form.
@asthanarht5 жыл бұрын
you should clear problem by example instead of repeating code block
@shivaniguptacv12153 жыл бұрын
Time complexity?
@dishagupta74463 жыл бұрын
Time complexity??
@shivamguptayoutube3 ай бұрын
Thanks!
@pushangupta48154 жыл бұрын
If anyone is having a hard time through this algorithm, I have an alternate solution... Traverse the given linked list by first visiting all the bottom nodes of each main nodes. As you traverse, make a binary search tree(AVL for better performance) and then do a preorder traversal and see the magic!
@rajveersanghvi66784 жыл бұрын
You mean inorder traversal?
@theguy54234 жыл бұрын
@@rajveersanghvi6678 yeah... My bad
@AmitRajArtist4 жыл бұрын
Thanks...
@keshavrastogi50055 жыл бұрын
Such a pathetic explanation. Did someone force you to make and upload video. Please don't do it as it waste lot of our time. We trust geeksforgeeks and that's why thought to watch this video.
@srinidhibhat39557 жыл бұрын
The explanation is sub-par compared to many of the videos in the play list. I feel it is essential to explain the code with an example thought the video and not just displaying the functions.
@GeeksforGeeksVideos7 жыл бұрын
Thanks for the feedback. We will share this with our contributors.
@30secondsEmotions4 жыл бұрын
for all those who are facing difficulty in understand this, I want to say that ,sir has explained very nicely, ,,but if you want other algorithm, you simply make the list linear by joining the vertical list in between two nodes,,,,,two nodes can be node from which it is attached and other node is it's adjacent node, and simply sort it,
@30secondsEmotions4 жыл бұрын
like this,,,, like you have a list which you want to flat, a function named-- makeFlattenedList() which simple makes the list linear without sorting,,,by joining vertical list in between two nodes of base list and after it call the function -- sortList (),,, it will sort the list
@sahilanower91893 жыл бұрын
hats off Harshit bro! Successfully wasted lot of my fucking time
@subham-raj4 жыл бұрын
*Use MinHeap that's much better*
@adityaaggarwal46224 жыл бұрын
Good jobs just need some support of logic and GFG are always there :)