We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
现实生活中很多结构都是树的抽象,模拟的树结构相当于旋转 180° 的树。
180°
数组:
链表:
哈希表:
树结构:
总的来说:每种数据结构都有自己特定的应用场景。
树(Tree):由 n(n ≥ 0)个节点构成的有限集合。当 n = 0 时,称为空树。
对于任意一棵非空树(n > 0),它具备以下性质:
//节点A Node{ //存储数据 this.data = data //统一只记录左边的子节点 this.leftChild = B //统一只记录右边的第一个兄弟节点 this.rightSibling = null } //节点B Node{ this.data = data this.leftChild = E this.rightSibling = C }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
树的特点:
现实生活中很多结构都是树的抽象,模拟的树结构相当于旋转
180°
的树。树结构对比于数组/链表/哈希表有哪些优势呢?
数组:
链表:
哈希表:
树结构:
总的来说:每种数据结构都有自己特定的应用场景。
树结构:
树(Tree):由 n(n ≥ 0)个节点构成的有限集合。当 n = 0 时,称为空树。
对于任意一棵非空树(n > 0),它具备以下性质:
树的常用术语:
树结构的表示方式
The text was updated successfully, but these errors were encountered: