All Elements in Two Binary Search Trees | Leetcode September Challenge (Day5) | Leetcode 1305

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

Quick Links
1) 0:00 Understanding the problem
2) 1:26 Splitting the problem into 2 parts
3) 2:32 Inorder traversal of a BST
4) 4:56 Merging of 2 sorted lists
5) 8:46 Coding it up
6) 14:23 Analysing the time complexity

Time complexity O(n), where n is the total no of elements in both the trees
Space complexity O(n), where n is the total no of elements in both the trees
Solution
Рекомендации по теме
Комментарии
Автор

Very elaborate, brushed up my basics. It could have been shorter. Increase the speed and then see.

sumedhaseth
Автор

I think it is not optimal one. It can be solved using stacks with time complexity o(m+n)

adityapandey
Автор

can you please make a playlist difficulty-wise of leetcode problems, a separate playlist for easy, medium, and hard problems ?
it would be very helpful.

swati
visit shbcf.ru