Count pairs from 2 BST whose sum is equal to given value "X" | BST | Love Babbar DSA Sheet | Amazon🔥

  Рет қаралды 8,723

Yogesh & Shailesh (CodeLibrary)

Yogesh & Shailesh (CodeLibrary)

Күн бұрын

Пікірлер: 17
@raviashwin1157
@raviashwin1157 3 жыл бұрын
Finally a high 1080p quality video 🤩
@voldemort576
@voldemort576 3 жыл бұрын
Bhai inorder traversal or searching me bhi recursive stack ki space lagagi!
@pokeindia5361
@pokeindia5361 Жыл бұрын
Wahi mera bhi doubt H!!?
@pritishpattnaik4674
@pritishpattnaik4674 3 жыл бұрын
great explanation , love ur content
@CodeLibrary
@CodeLibrary 3 жыл бұрын
Thanks
@shristisingh6539
@shristisingh6539 2 жыл бұрын
recursive stack ki space nhi lagegegi??
@akshatkumar4842
@akshatkumar4842 3 жыл бұрын
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?
@justarandomguy6106
@justarandomguy6106 2 жыл бұрын
Make 1 or 2 maps , and then it will be in o of n
@manu-singh
@manu-singh 3 жыл бұрын
awesome intro music
@memefulland7140
@memefulland7140 2 жыл бұрын
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
@nishantahlawat5643
@nishantahlawat5643 2 жыл бұрын
Space complexity is o(n+m). Sorting time complexity is o(nlogn)
@RamanKumar-mg8qs
@RamanKumar-mg8qs 2 жыл бұрын
@@nishantahlawat5643 mergre can be done in o(m +n) and pair can be found in o (m +n);
@warfarecreations379
@warfarecreations379 2 жыл бұрын
It's getting wrong because it can choose a pair in the same bst
@tusharsharma6518
@tusharsharma6518 6 ай бұрын
because it may find the 2 elements from same bst
@bhawnarajput5641
@bhawnarajput5641 2 жыл бұрын
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. 🙂
@codingachinilgtifirbhikrrh9009
@codingachinilgtifirbhikrrh9009 2 жыл бұрын
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
Largest BST in a Binary Tree | BST | Love Babbar DSA Sheet | Amazon🔥
21:24
Yogesh & Shailesh (CodeLibrary)
Рет қаралды 17 М.
كم بصير عمركم عام ٢٠٢٥😍 #shorts #hasanandnour
00:27
hasan and nour shorts
Рет қаралды 8 МЛН
The END of Adani, BGT & WoKEism | Sunday Show ft.@BidhuriRishabh
32:05
Sarthak Goswami
Рет қаралды 128 М.
KD-Tree Nearest Neighbor Data Structure
6:39
Stable Sort
Рет қаралды 121 М.
How to Solve ANY LeetCode Problem (Step-by-Step)
12:37
Codebagel
Рет қаралды 300 М.
Count pairs with given sum | Array | Love Babbar DSA Sheet | Amazon🔥
12:07
Yogesh & Shailesh (CodeLibrary)
Рет қаралды 93 М.
A Crash Course on Quantum Computing
6:26
MrJackpots
Рет қаралды 4
Check whether BST contains Dead End | BST | Love Babbar DSA Sheet | Amazon🔥
20:55
Yogesh & Shailesh (CodeLibrary)
Рет қаралды 12 М.
Convert Binary tree into BST  | Binary Search Tree | Love Babbar DSA Sheet | Amazon 🔥
12:43
Yogesh & Shailesh (CodeLibrary)
Рет қаралды 23 М.