Containers is a term used to define arrays or tables for they are used to store variables which are then indexed to be able to retrieve data from them. Hashes on the other hand can be described as dictionaries or associative arrays which are also indexed along with all object references. Arrays are indexed using integers but hashes can be index with any type of object such as a string, expression or the many other types of data they store. When you ask for the contents of a hash, you actually get the index/pointer and the content of the table corresponding to the said value that is stored within that certain value. You can then get the value by indexing the hash with that same key allowing easier/faster searches. Hashes are easier to use in certain instances for you can use any object as the index, on the disadvantage side though, since hashes are not ordered you might find it hard to easily hash a large stack or queue.
-
Pages
-
Categories
-
Archives
- August 2010
- July 2010
- June 2010
- May 2010
- April 2010
- March 2010
- February 2010
- January 2010
- December 2009
- November 2009
- October 2009
- September 2009
- August 2009
- July 2009
- June 2009
- May 2009
- April 2009
- March 2009
- February 2009
- January 2009
- December 2008
- November 2008
- October 2008
- September 2008
- August 2008
- July 2008
- June 2008
- May 2008
- April 2008
- March 2008
- February 2008
- January 2008
