Module: Algorithmable::Cups::StacksAndQueues
- Defined in:
- lib/algorithmable/cups/stacks_and_queues.rb,
lib/algorithmable/cups/stacks_and_queues/stack_sorter.rb,
lib/algorithmable/cups/stacks_and_queues/triple_stack.rb,
lib/algorithmable/cups/stacks_and_queues/stack_with_min.rb,
lib/algorithmable/cups/stacks_and_queues/towers_of_hanoi.rb,
lib/algorithmable/cups/stacks_and_queues/two_stacks_queue.rb
Defined Under Namespace
Modules: TowersOfHanoi
Classes: StackSorter, StackWithMin, TripleStack, TwoStacksQueue
Instance Method Summary
collapse
Instance Method Details
#new_stack_with_min ⇒ Object
14
15
16
|
# File 'lib/algorithmable/cups/stacks_and_queues.rb', line 14
def new_stack_with_min
StackWithMin.new
end
|
#new_tower_of_hanoi(index) ⇒ Object
26
27
28
|
# File 'lib/algorithmable/cups/stacks_and_queues.rb', line 26
def new_tower_of_hanoi(index)
TowersOfHanoi::Tower.new index
end
|
#new_triple_stack(size) ⇒ Object
10
11
12
|
# File 'lib/algorithmable/cups/stacks_and_queues.rb', line 10
def new_triple_stack(size)
TripleStack.new size
end
|
#new_two_stacks_queue ⇒ Object
18
19
20
|
# File 'lib/algorithmable/cups/stacks_and_queues.rb', line 18
def new_two_stacks_queue
TwoStacksQueue.new
end
|
#sort_stack(stack) ⇒ Object
22
23
24
|
# File 'lib/algorithmable/cups/stacks_and_queues.rb', line 22
def sort_stack(stack)
StackSorter.sort stack
end
|