All Questions
Tagged with binary-search ruby
4 questions
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 ...
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?
...
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 ...
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 ...