Last Modified
2017-09-09 18:04:42 -0500
  • tsort
  • rbtree


Copyright © 2002-2008 Akinori MUSHA <>

Documentation by Akinori MUSHA and Gavin Sinclair.

All rights reserved. You can redistribute and/or modify it under the same terms as Ruby.

$Id: set.rb 18571 2008-08-13 08:03:30Z knu $


This library provides the Set class, which deals with a collection of unordered values with no duplicates. It is a hybrid of Array’s intuitive inter-operation facilities and Hash’s fast lookup. If you need to keep values ordered, use the SortedSet class.

The method to_set is added to Enumerable for convenience.

See the Set class for an example of usage.