Re:They don't even know the fundamentals
by humen99 on Monday November 01, 2021 @05:46PM
(#29073592)
Binary search tree is more difficult than a binary tree. A BST is a BT but a BT is not a BST. So making a normal BT is just pointing nodes.
Re:They don't even know the fundamentals
by what_is_orcas on Wednesday November 03, 2021 @09:23AM
(#29094221)
Huh... TIL, as they say.
It's easy to make an imbalanced binary tree.
I once decided that building a binary tree based only on a friend's explanation of how they worked; it seemed like it would be a good learning exercise for myself (I don't have a CS degree). It was like 10 minutes of coding to get it minimally working & tested, but then I had to work out all of the different rotations to make it a balanced binary tree (I don't know that an imbalanced binary tree is ever actually useful, as it could just work out to be a slower linked-list in the worst case scenario).
I did it once, took me a little while, but I don't know that I could do it again without having to reexamine all of the different cases that result in imbalance and the rotations that respond to each.