Bhai inorder traversal or searching me bhi recursive stack ki space lagagi!
@pokeindia5361 Жыл бұрын
Wahi mera bhi doubt H!!?
@pritishpattnaik46743 жыл бұрын
great explanation , love ur content
@CodeLibrary3 жыл бұрын
Thanks
@shristisingh65392 жыл бұрын
recursive stack ki space nhi lagegegi??
@akshatkumar48423 жыл бұрын
Sir mera ek doubt h. Agar tree skewed hua tb to height 'm' ho jayega aur fir time complexity O(n*m) ho jayega. To ye sahi solution hoga?
@justarandomguy61062 жыл бұрын
Make 1 or 2 maps , and then it will be in o of n
@manu-singh3 жыл бұрын
awesome intro music
@memefulland71402 жыл бұрын
my approach: push bst1 and bst2 in two different vectors then merge those two vector in a vector v and sort the vector v then set i at 0 and j at v.size()-1 then simply count the pairs but why its getting wrong cAN ANYONE TELL ITS TIME AND SPACE COMPLEXITY
@nishantahlawat56432 жыл бұрын
Space complexity is o(n+m). Sorting time complexity is o(nlogn)
@RamanKumar-mg8qs2 жыл бұрын
@@nishantahlawat5643 mergre can be done in o(m +n) and pair can be found in o (m +n);
@warfarecreations3792 жыл бұрын
It's getting wrong because it can choose a pair in the same bst
@tusharsharma65186 ай бұрын
because it may find the 2 elements from same bst
@bhawnarajput56412 жыл бұрын
Jab ques me clearly likha hai ki O(n) me krna hai to O(n*h) soln kyun btate ho. kyuki bss gfg pe accept hojata hai weak testcases ki wajah se isliye code ko optimise hi ni karte. 🙂
@codingachinilgtifirbhikrrh90092 жыл бұрын
i think ques m galat de rkha h even gfg k editorial m O(n) ka koi solution nahi h, so this is the optimized solution