Graph
Definition
A data structure consisting of nodes (vertices) connected by edges. Graphs can be directed or undirected, weighted or unweighted. Used to model networks, social connections, maps, and dependencies.
Code Example
Learn More
Related Terms
A mathematical notation that describes the upper bound of an algorithm's time or space complexity as input size grows. Common complexities from fastest to slowest: O(1), O(log n), O(n), O(n log n), O(n^2), O(2^n).
Binary TreeA hierarchical data structure where each node has at most two children (left and right). A Binary Search Tree (BST) maintains the property that left children are smaller and right children are larger than the parent.
RecursionA technique where a function calls itself to solve smaller instances of the same problem. Every recursive function needs a base case (stopping condition) and a recursive case. Common in tree traversals, divide-and-conquer algorithms, and mathematical computations.