top of page

BINARY TREE SEARCH METHODS

A binary tree is made of nodes, and throughout the tree there are left pointers, right pointers, and elements with data. With the given components of a binary tree, I implemented a breadth first search algorithm and depth search first algorithm.

Binary Tree Search Methods: Publications
2018-01-24.png

DEPTH FIRST TRAVERSAL

The depth first traversal is a search algorithm for data structures. This search method traverses a data structure by following "branches", or paths (staying on one side of the list). The algorithm starts at the first element and travels to the next node until there are no more elements in the current path. It then moves backwards to find more elements to traverse.

2018-01-22 (4).png

BREADTH FIRST TRAVERSAL

The breadth first traversal is a search algorithm for data structures. The search method traverses the tree in layers, compared to traversing the tree by paths with the depth first traversal. This is accomplished by traversing the neighbor nodes, and then moving to the next layer of nodes once there are no neighbor nodes.

bottom of page