Module: Algorithmable::DataStructs
- Included in:
- Puzzles::DijkstrasTwoStacks, Puzzles::JosephusProblem
- Defined in:
- lib/algorithmable/data_structs.rb,
lib/algorithmable/data_structs/bag.rb,
lib/algorithmable/data_structs/deque.rb,
lib/algorithmable/data_structs/queue.rb,
lib/algorithmable/data_structs/stack.rb,
lib/algorithmable/data_structs/linked_list.rb,
lib/algorithmable/data_structs/ordered_symbol_table.rb
Defined Under Namespace
Classes: Bag, Deque, LinkedList, OrderedSymbolTable, Queue, Stack
Instance Method Summary
collapse
Instance Method Details
#new_bag ⇒ Object
10
11
12
|
# File 'lib/algorithmable/data_structs.rb', line 10
def new_bag
Bag.new
end
|
#new_fifo_queue ⇒ Object
18
19
20
|
# File 'lib/algorithmable/data_structs.rb', line 18
def new_fifo_queue
Queue.new
end
|
#new_lifo_queue ⇒ Object
22
23
24
|
# File 'lib/algorithmable/data_structs.rb', line 22
def new_lifo_queue
Stack.new
end
|
#new_linked_list ⇒ Object
14
15
16
|
# File 'lib/algorithmable/data_structs.rb', line 14
def new_linked_list
LinkedList.new
end
|
#new_ordered_symbol_table(key_type, value_type) ⇒ Object
26
27
28
|
# File 'lib/algorithmable/data_structs.rb', line 26
def new_ordered_symbol_table(key_type, value_type)
OrderedSymbolTable.new(key_type, value_type)
end
|