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

Defined Under Namespace

Classes: Bag, Deque, LinkedList, Queue, Stack

Instance Method Summary collapse

Instance Method Details

#new_bagObject



9
10
11
# File 'lib/algorithmable/data_structs.rb', line 9

def new_bag
  Bag.new
end

#new_fifo_queueObject



17
18
19
# File 'lib/algorithmable/data_structs.rb', line 17

def new_fifo_queue
  Queue.new
end

#new_lifo_queueObject



21
22
23
# File 'lib/algorithmable/data_structs.rb', line 21

def new_lifo_queue
  Stack.new
end

#new_linked_listObject



13
14
15
# File 'lib/algorithmable/data_structs.rb', line 13

def new_linked_list
  LinkedList.new
end