Binary Tree is a #202112101956 where every node could have at most 2 children.
Analysis
- The average depth of one binary tree is \(O(\sqrt[]{N})\)
Attention
- Many of the rules apply to 202110191729 will apply to this data structure as well
- Avoid sorted input
Implementation
typedef struct TreeNode *PtrToNode;
typedef strcut PtrToNode Tree;
struct TreeNode {
ElementType Element;
Tree Left;
Tree Right;
};