Skip to content
/ avl_tree Public

AVL tree and Red-black tree in Ruby

License

BSD-2-Clause, Unknown licenses found

Licenses found

BSD-2-Clause
LICENSE.BSD
Unknown
LICENSE.Ruby
Notifications You must be signed in to change notification settings

nahi/avl_tree

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

80 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AVL tree, Red-black tree in Ruby

avl_tree - AVL tree, Red-black tree and Lock-free Red black tree in Ruby Copyright (C) 2014 Hiroshi Nakamura [email protected]

Usage

You can use AVLTree, RedBlackTree or ConcurrentRedBlackTree just as a replacement of Hash.

@points = Hash.new
...
@points[score] = person
...
@points.each do |score, person|
  ...
end

->

require 'avl_tree'
@points = AVLTree.new

require 'red_black_tree'
@points = RedBlackTree.new
@points = ConcurrentRedBlackTree.new

AVLTree and RedBlackTree are faster but not thread-safe. Use ConcurrentRedBlackTree in multi-thread environment.

Author

Name:: Hiroshi Nakamura E-mail:: [email protected] Project web site:: http://github.com/nahi/avl_tree

License

This program is copyrighted free software by Hiroshi Nakamura. You can redistribute it and/or modify it under the same terms of Ruby's license; either the dual license version in 2003, or any later version.

About

AVL tree and Red-black tree in Ruby

Resources

License

BSD-2-Clause, Unknown licenses found

Licenses found

BSD-2-Clause
LICENSE.BSD
Unknown
LICENSE.Ruby

Stars

Watchers

Forks

Packages

No packages published

Languages