This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Put your answers here! | |
Michael-Riess-Computer:~ michaelriess$ rvm list | |
rvm rubies | |
ruby-1.8.7-p302 [ i686 ] | |
ruby-1.9.2-p290 [ x86_64 ] | |
=* ruby-1.9.2-p318 [ x86_64 ] | |
ruby-1.9.2-p320 [ x86_64 ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Create an RPNCalculator class which can evaluate expressions | |
written in Reverse Polish notation. | |
It should have an evaluate instance method which takes as its | |
input a valid RPN expression and returns its evaluation. Your | |
calculator only needs to handle addition, multiplication, and | |
subtraction (not division). | |
Operators and numbers should be separated by a single space. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Write a method mode which takes an Array of numbers | |
as its input and returns an Array of the most frequent values. | |
If there's only one most-frequent value, it returns a | |
single-element Array. | |
For example, | |
mode([1,2,3,3]) # => [3] | |
mode([4.5, 0, 0]) # => [0] |
NewerOlder