Merge K sorted lists | Leetcode 23 | Leetcode Hard 🔥🔥🔥| 2 Approaches | K log K | Live coding session

preview_player
Показать описание

1) 0:00 Explaining the problem out loud
2) 1:28 Algorithm walkthrough
3) 4:00 Coding it up
4) 6:00 Time complexity

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

Hard Day made easy. Awesome explanation👍

simranjeetrandhawa
Автор

Ok, so I have a question, the solution I submitted was of the priority queue, which takes O(n) space, say If I have used the merge algorithm, the one from merge 2 sorted list logic, It would have taken recursion stack, now I'm not declaring any space by myself BUT the RECURSION STACK is itself is taking the space, so in conclusion, can we say that Binary Heap AND recursion stack have the same complexity, they just differ in the way they're declared?. We're creating a minHeap and Recursion stack is getting created automatically?.
Thanks

RajatSingh-dgov