i worked on binary search tree today I did insert, bfs and dfs but now I just saw your search one and its helpful and the delete one. thanks for this video omg.
@abskrnjn4 ай бұрын
Wow too detailed and long video, will watch just before exams..
@venzdrop4 ай бұрын
i like the second searching code. great.
@陈哲轩-t2m3 ай бұрын
Well done. Sorted through my thought modules.
@Byte_Quest3 ай бұрын
Thnks
@JetLagRecords4 ай бұрын
ByteQuest, nice video keep it up bro
@Byte_Quest4 ай бұрын
Thanks
@venzdrop4 ай бұрын
on the else: return? on def insert. wdym by return? it returns nothing?
@Byte_Quest4 ай бұрын
Return means just return None.
@venzdrop4 ай бұрын
so when deleting root with two child, "we look for the biggest on the left or we look for smallest on the right? " or "we look at smallest from the left or biggest from the right? "
@Byte_Quest4 ай бұрын
Smallest in the right subtree.
@venzdrop4 ай бұрын
@@Byte_Quest got it. and biggest in the left subtree. thanks
@venzdrop4 ай бұрын
so what is the worst case for insertion and why?
@Byte_Quest4 ай бұрын
It's O(height) Best case when the tree is balanced in which case it would be O(log(n)) Worst case when the tree is unbalanced meaning the complexity will degrade to O(n), because the height is proportional to n in when unbalanced.
@Byte_Quest4 ай бұрын
Next video would be on "AVL tree" where balancing will be discussed in greater detail.