Tag : ruby

I am trying to create an initialize method in Ruby that, when using BSTclass.new(...), expects a block of code as a parameter. If a block of code is provided, the code must compare two objects in the tree when adding an element or searching for an element; the block needs to accept two parameters and return 1, -1, or 0. If no block is provided, the <=> operator must be used. I have the following code ..

Read more