CodeX
Published in

CodeX

Data Structures & Algorithms in Ruby: Depth-First Search (Post-order) for Binary Trees

Last week we introduced the concept of Depth-First Search for Binary Tree traversals. Of the three main types of Depth-First Search (DFS) algorithms, we began with a pre-order search, which begins at the root node of the binary tree and returns each node visited on the way down the left side of the tree, then down the right side of the tree. Like our discussion of Breadth-First Search, the root node is the first value returned in a pre-order DFS. In a Depth-First Search Post-Order algorithm, the first value in…

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Anthony Lepore

Anthony Lepore

Composer, playwright, designer for theater, jazz musician, philosopher, software engineer and technical writer for a FinTech firm in NYC. More: ViolaCello93.com