set.rb

Path: lib/set.rb
Last Update: Tue Mar 13 02:07:05 -0500 2007

Copyright (c) 2002 Akinori MUSHA <[email protected]>

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 11980 2007-03-03 16:06:45Z knu $

Overview

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.

Required files

tsort   rbtree  

[Validate]

ruby-doc.org is hosted and maintained by James Britt and Rising Tide Software, a Ruby application development company in Phoenix, Arizona. The site was created in 2002 as part of the Ruby Documentation Project to promote the Ruby language and to help other Ruby hackers.

Documentation content on ruby-doc.org is provided by remarkable members of the Ruby community.

For more information on the Ruby programming language, visit ruby-lang.org.

Want to help improve Ruby's API docs? See Ruby Documentation Guidelines.