CodeX
Published in

CodeX

Data Structures & Algorithms in Ruby: Breadth-First Search for Binary Trees

Solution using our custom Queue Class

Last week, we implemented a #find method for our Binary Search Tree which returned the Boolean true/false indicating whether our value was found or not. What if we wanted to return all the nodes in our Binary Search Tree? Look at a representation of any Binary Tree (it doesn’t even have to be a Binary Search Tree). If you were asked to write some code to return…

--

--

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