Delete a Node in BST | Deletion in BST | Delete a Node in Binary Search Tree | DSA-One Course #68

  Рет қаралды 77,157

Anuj Bhaiya

Anuj Bhaiya

Күн бұрын

Пікірлер: 59
@startupmindset7597
@startupmindset7597 Жыл бұрын
my all friends learn things from different coaching classes in hydrabad ,Mumbai or pune ....but they have not much knowledge in programming , but i learn from anuj bhaiya DSA one course which is free and i have so much knowledge , compare to my friends , they always call me to ask the doubts, ... thank you ANUJ BHAIYA for this great course .....free for us.....
@girlysh09
@girlysh09 Жыл бұрын
then suggest them this playlist dude
@digvijay17july
@digvijay17july 3 жыл бұрын
Finally, one of the awaited videos For BST Lovers 🤣
@trishnapatil4594
@trishnapatil4594 2 жыл бұрын
What a wonderful explanation to an otherwise complex problem! Loved it! Thanks a lot!
@highonpeeks
@highonpeeks 2 жыл бұрын
was stuck on this from long time but after watching this video, the concept is crystal clear
@SaiKiranPatro
@SaiKiranPatro 10 ай бұрын
No one can better explain than Anuj Bhaiya ❤
@iamnoob7593
@iamnoob7593 19 күн бұрын
Explanation is brilliant
@raunakrhishabh2773
@raunakrhishabh2773 Жыл бұрын
The way u explain & made things visualize, its awsm!!! Thnx bro
@kartikeyrawat5456
@kartikeyrawat5456 11 ай бұрын
Very nice explanation !!! God bless you.
@shinratenten5686
@shinratenten5686 2 жыл бұрын
experienced it many times, you make every concept easier
@stith_pragya
@stith_pragya Жыл бұрын
Thank You So Much for this wonderful video........🙏🏻🙏🏻🙏🏻🙏🏻🙏🏻🙏🏻
@tushargogiya4017
@tushargogiya4017 2 жыл бұрын
Nice Explanation bhaiya hats off to you
@pallavigavali2671
@pallavigavali2671 3 жыл бұрын
Thank you bhaiya 👍
@parasdua4242
@parasdua4242 2 жыл бұрын
So, smooooooth Amazing ✨
@lokendrasingh9780
@lokendrasingh9780 3 жыл бұрын
Bhaiya whiteboard is best 👍❤️ thank you bhaiya ❤️❤️
@PicachuPicachu-e5k
@PicachuPicachu-e5k Жыл бұрын
sir jo program ko aap smjhate ho usko bhi description me dal de to or bhi benefitial ho...smjhne mei
@saritaprasad4295
@saritaprasad4295 2 жыл бұрын
tough topic explanation in easy way
@pt_harshit
@pt_harshit 3 жыл бұрын
Nice...
@meenakshidwivedi83
@meenakshidwivedi83 2 жыл бұрын
Truely Awesome..Thanks
@PicachuPicachu-e5k
@PicachuPicachu-e5k Жыл бұрын
sir program ko pura show kiya kre #include se end tk...plz...otherwise samjhne me dikkt aati h
@jatindigra4329
@jatindigra4329 2 жыл бұрын
awesome !! loved the explanation !!
@rahulsinghshekhawat2487
@rahulsinghshekhawat2487 2 жыл бұрын
great explanation !!!
@zakyvids6566
@zakyvids6566 3 жыл бұрын
Hi Anuj Bhaiya I like your content a lot But I had a request please make oops in python as well as how to use pyautogui and selenium Thanks a lot Love from Australia ❤️❤️❤️❤️❤️👍👍👍👍👍
@pratimdutta1979
@pratimdutta1979 Жыл бұрын
thank you sir
@girishmahajan4130
@girishmahajan4130 2 жыл бұрын
Thank you so much bhaiya
@dhanrajlouvanshi7872
@dhanrajlouvanshi7872 2 жыл бұрын
Thanks
@AK-ft7fd
@AK-ft7fd Жыл бұрын
This solution in leetcode shows RUNTIME ERROR. Please help!
@MUHAMMADALISHAFIQUE-w2d
@MUHAMMADALISHAFIQUE-w2d 7 ай бұрын
many times better than apna college not spreading hate but its fact 100%
@abhinavsinha8116
@abhinavsinha8116 3 жыл бұрын
Sir, I need your java placement cousre playlist which got deleted. There very important lectures in that playlist. Please do somethng.
@nikgshort3974
@nikgshort3974 2 жыл бұрын
Yes sir
@sankalpgupta5505
@sankalpgupta5505 3 жыл бұрын
bhaiya are you going to cover graphs and DP as well???
@anujkumarsharma1013
@anujkumarsharma1013 3 жыл бұрын
Yes, these topics will come after.
@babunmadhab
@babunmadhab 2 жыл бұрын
@@anujkumarsharma1013 bhaiya code thoda link description m de dijiye na
@NishantKumar-bu7wh
@NishantKumar-bu7wh 9 ай бұрын
Can anyone please explain that if the root of updated subtree is already attached to the root of the BST, why is it explicitly compulsory to attach again to the root of the BST?
@gtbaba123
@gtbaba123 2 жыл бұрын
Bro I love u
@creativevision9204
@creativevision9204 2 жыл бұрын
Please share iterative approach as well.
@pranavnyavanandi9710
@pranavnyavanandi9710 2 жыл бұрын
I will try implementing one on my own.
@musqitonebeats2129
@musqitonebeats2129 2 жыл бұрын
time complexity?
@Coding_Destini
@Coding_Destini 2 жыл бұрын
Bhaiiyya but where we are checking when key (data to be delete) == root.data ????
@abhisheknag1929
@abhisheknag1929 Жыл бұрын
that is else part only
@sankalpgupta5505
@sankalpgupta5505 3 жыл бұрын
bhaiya please make a roadmap on international placements🙏❤️
@souhardyahalder3903
@souhardyahalder3903 2 жыл бұрын
Na bhai national karlo pehle... international se kya hoga
@tushargogiya4017
@tushargogiya4017 2 жыл бұрын
@@souhardyahalder3903 ilets krlega😂😂😂😂
@anshulsingh1265
@anshulsingh1265 3 жыл бұрын
Done
@MACR_RaviKumar
@MACR_RaviKumar 2 жыл бұрын
❤❤
@codingiseasy8
@codingiseasy8 2 жыл бұрын
Nic sir
@coftanurag
@coftanurag Жыл бұрын
I think you miss leaf node deletion case
@deepakantoj432
@deepakantoj432 2 жыл бұрын
the question is to delete a node from BST my approach is that i'll first get the key node and then also get the parent node of the key node . connect the parent node's left or right to key node's right . and store the key node's left in a temp node i'll traverse to the very left of the newly connected parent's left and attach the temp . /** * Definition for a binary tree node. * public class TreeNode { * int val; * TreeNode left; * TreeNode right; * TreeNode() {} * TreeNode(int val) { this.val = val; } * TreeNode(int val, TreeNode left, TreeNode right) { * this.val = val; * this.left = left; * this.right = right; * } * } */ class Solution { public TreeNode deleteNode(TreeNode root, int key) { TreeNode node = solve(root,key); // key node TreeNode n = helper(root,key); // parent node if(n.left != null) if( n.left.val == key) n.left = node.right; else if(n.right != null) if(n.right.val == key) n.right = node.right; TreeNode left = node.left; TreeNode cur = node.right; while(cur.left!=null) { cur = cur.left; } cur.left = left; return root; } public TreeNode helper(TreeNode root , int val) { if(root == null) return null; if(root.left!=null) { if(val == root.left.val) return root; } else if(root.right!=null){ if(val == root.right.val) return root; } return val > root.val ? helper(root.right , val) : helper(root.left , val); } public TreeNode solve(TreeNode root , int val) { if(root == null) return null; if(val == root.val) return root; return val > root.val ? solve(root.right , val) : solve(root.left , val); } } where have i gone wrong anybody please help
@chandraveersingh5561
@chandraveersingh5561 3 жыл бұрын
Hi Bhaiya! Mera comment pin krdo Mai dosto ko dikhao ga
@yashrajpathak8103
@yashrajpathak8103 2 жыл бұрын
fir tu isse apne resume me bhi laga lio bhai
@codingwithsukesh
@codingwithsukesh Жыл бұрын
💖💖👍👍
@prem-i7h
@prem-i7h 3 жыл бұрын
Bhaiya thodi jldi jldi videos bnaya kro ,reach ni bdh ri
@rudrakshdatta4389
@rudrakshdatta4389 2 жыл бұрын
Share the code of delete and insert node in a Binary Search Tree
@pandeyshashidhar
@pandeyshashidhar 2 жыл бұрын
In leetcode code is showing TLE class Solution { public TreeNode deleteNode(TreeNode root, int key) { if(root == null) return null; if(key < root.val) root.left = deleteNode(root.left,key); else if(key>root.val) root.right = deleteNode(root.right,key); else{ if(root.left == null) return root.right; else if(root.right == null) return root.left; root.val = maxElement(root.right); root.right = deleteNode(root.right,root.val); } return root; } public int maxElement(TreeNode root){ while(root.left != null){ root.val = root.left.val; } return root.val; } }
@praminthakur8166
@praminthakur8166 2 жыл бұрын
In the maxElement() method , you are not setting a condition for the while loop to end. Thus, it will give TLE. It should be : public int minElement(TreeNode root){ int minv = root.val; while(root != null){ if(root.val < minv) minv = root.val; root = root.left; } return minv; }
@NayeemKhan-gg2nc
@NayeemKhan-gg2nc Жыл бұрын
in your maxElement function inside while loop you have to add root = root.left;
@DianaAnahíLedesmaRoque
@DianaAnahíLedesmaRoque 10 ай бұрын
He talks very quickly 😅
@PatitapabanBisoi
@PatitapabanBisoi Жыл бұрын
Thanks
L44. Delete a Node in Binary Search Tree | BST | C++ | Java
15:48
take U forward
Рет қаралды 225 М.
The evil clown plays a prank on the angel
00:39
超人夫妇
Рет қаралды 53 МЛН
Tuna 🍣 ​⁠@patrickzeinali ​⁠@ChefRush
00:48
albert_cancook
Рет қаралды 148 МЛН
She made herself an ear of corn from his marmalade candies🌽🌽🌽
00:38
Valja & Maxim Family
Рет қаралды 18 МЛН
Understanding B-Trees: The Data Structure Behind Modern Databases
12:39
Delete Node in a BST - Leetcode 450 - Python
12:59
NeetCodeIO
Рет қаралды 53 М.
Delete a node from Binary Search Tree
18:27
mycodeschool
Рет қаралды 1,2 МЛН
Deletion in a Binary Search Tree
22:42
CodeWithHarry
Рет қаралды 209 М.
Tree Implementation in Java | DSA
17:03
Telusko
Рет қаралды 60 М.
10.1 AVL Tree - Insertion and Rotations
43:08
Abdul Bari
Рет қаралды 1,3 МЛН
Delete a node from Binary Search Tree( Reason for every operation explained)
23:09
Vivekanand Khyade - Algorithm Every Day
Рет қаралды 97 М.
Binary Trees - Data Structures Explained
10:18
Aaron Jack
Рет қаралды 149 М.
The evil clown plays a prank on the angel
00:39
超人夫妇
Рет қаралды 53 МЛН