Garrison Jensen

Results 9 comments of Garrison Jensen

It looks like this issue can be closed.

I can confirm that deleting a non-existent element causes a segmentation fault _sometimes_. If you run `rspec` ten times or so you should see a segmentation fault.

Causes seg fault with ruby 3.2.2 ``` require 'algorithms' include Containers tree = CRBTreeMap.new tree.push(2, 2) tree.delete(3) ```

A similar issue exists inside RubyRBTreeMap ``` require 'algorithms' include Containers tree = RubyRBTreeMap.new tree.push(2,2) tree.delete(3) ``` ``` `delete_recursive': undefined method `left' for nil:NilClass (NoMethodError) if ( !isred(node.right) && !isred(node.right.left)...

I have a fix waiting for a PR review.

I have a fix waiting for review https://github.com/kanwei/algorithms/pull/54

@dblock A good name for this might be `take` because it looks like this works same way as `Array#take`.