Размер видео: 1280 X 720853 X 480640 X 360
Показать панель управления
Автовоспроизведение
Автоповтор
Can we do this without taking extra space to store the inorder traversal of root1 and root2?
Tried itCouldn't find a way
@@maskedcoder-dy1ub we can use the concept of merging 2 BST into 1 BST and then finding the inorder. We will first convert both the trees into sorted LL, merge these two sorted LLs into one sorted LL and then create a new tree using the merged list.
Can we do this without taking extra space to store the inorder traversal of root1 and root2?
Tried it
Couldn't find a way
@@maskedcoder-dy1ub we can use the concept of merging 2 BST into 1 BST and then finding the inorder.
We will first convert both the trees into sorted LL, merge these two sorted LLs into one sorted LL and then create a new tree using the merged list.