Module: Algorithmable::DataStructs

Included in:
Puzzles::DijkstrasTwoStacks, Puzzles::JosephusProblem, Sort::BinaryHeap
Defined in:
lib/algorithmable/data_structs.rb,
lib/algorithmable/data_structs/bag.rb,
lib/algorithmable/data_structs/heap.rb,
lib/algorithmable/data_structs/deque.rb,
lib/algorithmable/data_structs/queue.rb,
lib/algorithmable/data_structs/stack.rb,
lib/algorithmable/data_structs/heap/imp.rb,
lib/algorithmable/data_structs/heap/max.rb,
lib/algorithmable/data_structs/heap/min.rb,
lib/algorithmable/data_structs/linked_list.rb,
lib/algorithmable/data_structs/ordered_symbol_table.rb

Defined Under Namespace

Modules: Heap Classes: Bag, Deque, LinkedList, OrderedSymbolTable, Queue, Stack

Instance Method Summary collapse

Instance Method Details

#new_bagObject



11
12
13
# File 'lib/algorithmable/data_structs.rb', line 11

def new_bag
  Bag.new
end

#new_fifo_queueObject



19
20
21
# File 'lib/algorithmable/data_structs.rb', line 19

def new_fifo_queue
  Queue.new
end

#new_lifo_queueObject



23
24
25
# File 'lib/algorithmable/data_structs.rb', line 23

def new_lifo_queue
  Stack.new
end

#new_linked_listObject



15
16
17
# File 'lib/algorithmable/data_structs.rb', line 15

def new_linked_list
  LinkedList.new
end

#new_max_priority_heap(collection = []) ⇒ Object Also known as: new_max_priority_queue



31
32
33
# File 'lib/algorithmable/data_structs.rb', line 31

def new_max_priority_heap(collection = [])
  Heap::Max.new(collection)
end

#new_min_priority_heap(collection = []) ⇒ Object Also known as: new_min_priority_queue



37
38
39
# File 'lib/algorithmable/data_structs.rb', line 37

def new_min_priority_heap(collection = [])
  Heap::Min.new(collection)
end

#new_ordered_symbol_table(key_type, value_type) ⇒ Object



27
28
29
# File 'lib/algorithmable/data_structs.rb', line 27

def new_ordered_symbol_table(key_type, value_type)
  OrderedSymbolTable.new(key_type, value_type)
end