Find Inorder Successor and Predecessor in a BST | Binary Search Tree | Babbar DSA Sheet | Amazon 🔥

preview_player
Показать описание
#bst #binarysearchtree #competitiveprogramming #coding #dsa
Hey, Guys in this video I have explained with code how we can solve the problem 'Find Inorder Successor and Predecessor in a BST'.


Join our Telegram Channel for more Information

🔰 Get 10% OFF on all GeeksforGeeks Courses
Coupon Code = CODELIBRARY

Follow us on Instagram:

Follow us on LinkedIn:

Hope you like it. Comment if you have any doubt

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

Sir I was doing this with another array but this was the kind of explanation I was looking for. Thank you sir really helpful.

anshikgupta
Автор

Have a look 5 lines in C++

void findPreSuc(Node* root, Node*& pre, Node*& suc, int key)
{
if(!root) return ;
findPreSuc(root->left, pre, suc, key);
if(root->key<key)pre=root;
if(root->key>key && suc==0) suc=root;
findPreSuc(root->right, pre, suc, key);

}

btw i really liked your approach specially that one right and extreme left part

adityashekhartiwary
Автор

Surely one of the best tutorials 👍 keep inspiring 💯

sanketkudapane
Автор

where are you handling the case for -1? at 15:05

rohandevaki
Автор

Bro Tere playlist abhi bahut popular hogi...best wishes❤️

raviashwin
Автор

bhai tera code dekh kay he samj ata hai . keep it up bhai ;
love from bihar :

shreyankshrestha
Автор

Sir you are doing good work none of the you tuber is solving love babbar sir sheet

siddhantyadav
Автор

bhaiya aap kaun sa software use karte ho teaching ke liye? jispe likh kar samjha rhe ho?

CodeSolve-bySandeep
Автор

can this be done with inorder traversal recursively?

milton_tom
Автор

Very nicely explained bhai.Keep it Up!

hiteshusingh
Автор

bhaiya same to same krne pr bhi run time error kyo aa rha hai ?

himanshunagar
Автор

bhai agar jo key present nahi uske lie pre -1 aur suc -1 print karna ho to kaise kareng?

sanyamdeepsingh
Автор

Successor and Inorder Successor dono alag alag hai kya?

krushnapatil
Автор

Very nice videos ✨✨.... please make bst videos too🙈

snehajain
Автор

bhai aap kab se ye sheet solve kr rhe ho ki score 700+ ho gyi hai amezing please abhi aap kya kr rhe ho mujhe reply de do i mean job ya anything else . maine ye video apne college group me shere kr diya mera college nit calicut hai .

VikashSingh-kgxr
Автор

can you put this code in github and post the link.

abhishekvardhan
Автор

How it's printing -1 if succ or pred does not exist ?

kumarivandana
Автор

Bro u r doing, such a great thing
but it will be useful if u use more english words than hindi

dharanyuvi