Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
3 votes
2 answers
6k views

Breadth and Depth First Search in Ruby

I was tasked with building three individual methods; one to create a Binary Search Tree (BST), one to carry out a Breadth First Search (BFS), and one to carry out a Depth First Search (DFS). Create ...
scobo's user avatar
  • 601
6 votes
2 answers
3k views

Binary Search Tree in Ruby

Binary Search Tree, with preorder traverse. What other methods should I add? How can I improve it? ...
aarti's user avatar
  • 923
5 votes
1 answer
614 views

BinarySearch Kata in Ruby

I've just completed this binary search kata - which has some weird requirements - and I spent a little while "cleaning" up my code and making it more compact. I would appreciate some feedback on the ...
user341493's user avatar
2 votes
1 answer
546 views

First Occurrence of Number in Binary Search?

I am trying to write a function, where given a sorted array, and a number, it returns the FIRST index of that number. Is this correct? Code is in Ruby, but even if you don't know Ruby, you can pretty ...
Henley Wing Chiu's user avatar