-
A tree is a nonlinear data structure, compared to arrays, linked lists, stacks and queues which are linear data structures.
-
A tree can be empty with no nodes or a tree is a structure consisting of one node called the root and zero or one or more subtrees.
-
A tree can be defined recursively as a collection of nodes (starting at a root node), where each node is a data structure consisting of a value, together with a list of references to nodes (the "children"), with the constraints that no reference is duplicated, and none points to the root.
- Manipulate hierarchical data.
- Make information easy to search (see tree traversal).
- Manipulate sorted lists of data.
- As a workflow for compositing digital images for visual effects.
- Router algorithms
- Form of a multi-stage decision-making (see business chess).
- Compilers
- File system
- Data compression
- Digital signature algorithm
- Heap
- Network routing protocol
- Abstract syntax tree
- Document Object Model
- Decision tree learning
- Minimax tree
- Expectiminimax tree
- Monte Carlo tree search
- Min-max tree
- Min-max heap
- Suffix tree
- Suffix array
- B+ tree, B-tree, and B*-tree
- Red-black tree
- AVL tree
- Splay tree
- Treap
- T-tree
- AA tree
- Scapegoat tree, etc.
- Using a struct.
- Access: O(n)
- Search: O(n)
- Insertion: O(1)
- Deletion: O(1)
- O(n)
- Invert Binary Tree | Easy | Solution | Problem Description
- Maximum Depth of Binary Tree | Easy | Solution | Problem Description
- Diameter of Binary Tree | Easy | Solution | Problem Description
- Balanced Binary Tree | Easy | Solution | Problem Description
- Same Tree | Easy | Solution | Problem Description
- Subtree of Another Tree | Easy | Solution | Problem Description
- Lowest Common Ancestor of a Binary Search Tree | Medium | Solution | Problem Description
- Binary Tree Level Order Traversal | Medium | Solution | Problem Description
- Binary Tree Right Side View | Medium | Solution | Problem Description
- Count Good Nodes in Binary Tree | Medium | Solution | Problem Description
- Validate Binary Search Tree | Medium | Solution | Problem Description
- Kth Smallest Element in a BST | Medium | Solution | Problem Description
- Construct Binary Tree from Preorder and Inorder Traversal | Medium | Solution | Problem Description
- Binary Tree Maximum Path Sum | Hard | Solution | Problem Description
- Serialize and Deserialize Binary Tree | Hard | Solution | Problem Description
Category: Trees
Status: In Progress
Author: David Bujosa