/Stack-Test

stack data structure implementation in ruby

Primary LanguageRuby

README

Stack data structure implementation in ruby that calculate maximum value and average on large number of data.

include:

A class "Stack" that exposes the following characteristics: • Public method "push" that receives an unsigned integer number as parameter and store the numbers internally while keeping the order they where pushed. • Public method "pop" that returns the previously "pushed" numbers in reversed order. • Public method "max" which returns the highest number of the numbers in the stack.

A class "Extras" which includes all the methods "Stack" and the following characteristics: • Public method "mean" which return the average value of the numbers in the stack.