Please enable JavaScript.
Coggle requires JavaScript to display documents.
MM12 - EDOO, Binary Tree Traversals and Related Properties, Searching and…
MM12 - EDOO
Types
Binary Trees: Each node has at most two children, referred to as the left child and the right child.
Binary Search Trees (BST): A binary tree where for every node, the left subtree contains values less than the node, and the right subtree contains values greater than the node.
Balanced Trees: Trees that maintain a balanced height to ensure efficient operations. Examples include AVL trees and Red-Black trees.
Specialized Trees: Other trees designed for specific purposes, such as B-trees (used in databases), Heaps (used in priority queues), and Tries (used in dictionaries and spell checkers).
Properties
Height and Depth: Height is the length of the longest path from the root to a leaf, while depth is the length of the path from the root to a node.
-
-
Balanced vs. Unbalanced Trees: Balanced trees ensure O(log n) height, improving performance of operations.
Basic Tree Operations
-
-
Traversal: Visiting all nodes in a specific order. Types include preorder, inorder, and postorder traversals.
-
-
A tree is a hierarchical data structure consisting of nodes connected by edges. Each tree has a root node, and every other node is either a leaf or an internal node with children.
Important terms include root (the top node), node (basic unit of a tree), edge (connection between nodes), leaf (a node with no children), and subtree (a tree formed by a node and its descendants).
-
-