Written by the Fiveable Content Team โข Last updated August 2025
Verified for the 2026 exam
Verified for the 2026 examโขWritten by the Fiveable Content Team โข Last updated August 2025
Definition
Partial traversal refers to the process of visiting only a portion of the nodes in a data structure, such as a tree or graph. It involves exploring some nodes while skipping others.
Depth-first traversal: A type of partial traversal where we explore as far as possible along each branch before backtracking.
Breadth-first traversal: Another type of partial traversal where we visit all the nodes at one level before moving on to the next level.
Pre-order traversal: A specific way of partially traversing a binary tree by visiting the current node first, then its left subtree, and finally its right subtree.