The topic of tree has been discussed recently in class, so I summarized some general characteristics of different types of trees we have learned so far.
We've learned different types of data structures such as linear data structures stack and array to store information in computer. Tree is a logical model in python, it is a recursive date structure used to represent hierarchical data. The node on the top of the tree is called the root, each node can contain any type of data, or sometimes a link or a reference to other nodes called children.
A binary tree is a common tree having an important property that each node of a binary tree is able to have at most two children: left child and right child.
Moreover, a binary search tree is an ordered binary tree that its left subtree of a node contains only nodes with keys less that the node's key while its right subtree of a node contains only nodes with keys greater than the node's key, for both the left and right subtrees are also binary search trees.
No comments:
Post a Comment