Class: Algorithms::BasicAlgo

Inherits:
Object
  • Object
show all
Defined in:
lib/algorithmes.rb

Class Method Summary collapse

Class Method Details

.max(a, b) ⇒ Object



3
4
5
6
# File 'lib/algorithmes.rb', line 3

def self.max(a,b)
  return b unless a > b
  return a
end

.min(a, b) ⇒ Object



8
9
10
11
# File 'lib/algorithmes.rb', line 8

def self.min(a,b)
  return b unless a < b
  return a
end