Class: Zadt::ADT

Inherits:
Object
  • Object
show all
Defined in:
lib/zadt/HelpModules/adt_help.rb,
lib/zadt/HelpModules/adt_graph_help.rb,
lib/zadt/HelpModules/adt_geometrics_help.rb,
lib/zadt/HelpModules/adt_linkedlist_help.rb,
lib/zadt/HelpModules/adt_stackqueue_help.rb

Class Method Summary collapse

Class Method Details

.helpObject



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/zadt/HelpModules/adt_help.rb', line 3

def self.help
  puts "Thank you for using Zagorski Abstract Data Types!"
  puts "This package contains the following Data Types:"

  puts "Array-Like Data Types"
  puts "-Stack, a LIFO array with functions push and pop"
  puts "-Queue, a FIFO array with functions enqueue and dequeue"
  puts "-StackQueue, a Queue that is Stack-based (no real difference)"
  puts "-MinMaxStack, a Stack that can return Min and Max in constant time"
  puts "-MinMaxStackQueue, a Queue that can return Min and Max in constant time"

  puts "Graph Data Types"
  puts "-Graph, consisting of Vertices connected by Edges"
  puts "--Vertex, a 'spot' on the graph"
  puts "--Edge, connects two vertices"
  puts "-FaceGraph, a sub-class of Graph which includes Faces"
  puts "--Face, a space surrounded by a cycle of Edges.  Consists of Vertices and the Edges connecting them"

  puts "Linked Lists"
  puts "-LinkedListNode, an object containing a value (val), and a pointer to the next link (next)."
  puts "-DoublyLinkedListNode, an object containing a value (val), a pointer to the next link (next), and a pointer to the previous link (prev)."


  puts "Geometrics"
  puts "-Universe, consisting of Points and Spheres"
  puts "--Point, a 'spot' in the universe"
  puts "--Sphere, a set of points in a certain number of dimensions that is equidistant from a given point, called the Center"

  puts ""
  puts "Each data type also has a help function.  Type Zadt::Stack::help for a list of Stack methods, and so on for each data type."
end

.show_circle_help_messageObject



25
26
27
28
29
30
# File 'lib/zadt/HelpModules/adt_geometrics_help.rb', line 25

def self.show_circle_help_message
  puts "The following methods are specific to a Circle (2-dimensions):"
  puts "#area"
  puts "#circumference"
  puts "#equation, which returns a string in the form of (x-a)^2 + (y-b)^2 = r^2"
end

.show_doublylinkedlist_help_messageObject



9
10
11
12
13
14
# File 'lib/zadt/HelpModules/adt_linkedlist_help.rb', line 9

def self.show_doublylinkedlist_help_message
  puts "Here are the functions for DoublyLinkedListNode:"
  puts "#val"
  puts "#next"
  puts "#prev"
end

.show_face_graph_help_messageObject



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/zadt/HelpModules/adt_graph_help.rb', line 13

def self.show_face_graph_help_message
  puts "Here are the methods for FaceGraph:"
  puts "#add_face(edges_array), makes a face with the given edges (must be cyclicly connected)"
  puts "#make_original_face(num_edges), which makes a standard disconnected face"
  puts "#add_attached_face(vertex_array, num_edges), which adds a face connected to the vertex_array"
  puts "#find_neighbors(vertex_array), lists all faces containing the given vertices"
  puts "#find_face_neighbors(face), which finds all neighbors of the given face"
  puts "--a neighbor of a face is defined as one that shares a vertex (not necessarily an edge)"
  puts ""
  puts "FaceGraph also inherits the following methods from Graph:"
  puts "#add_vertex"
  puts "#remove_vertex(vertex)"
  puts "#make_connection(v1,v2), adds an edge between two vertices"
  puts "#break_connection(v1,v2)"
  puts "#find_connection(v1,v2), returns edge connecting two given vertices"
  puts "#is_connected?(v1,v2)"
end

.show_graph_help_messageObject



3
4
5
6
7
8
9
10
11
# File 'lib/zadt/HelpModules/adt_graph_help.rb', line 3

def self.show_graph_help_message
  puts "Here are the methods for Graph:"
  puts "#add_vertex"
  puts "#remove_vertex(vertex)"
  puts "#make_connection(v1,v2), adds an edge between two vertices"
  puts "#break_connection(v1,v2)"
  puts "#find_connection(v1,v2), returns edge connecting two given vertices"
  puts "#is_connected?(v1,v2)"
end

.show_hypersphere_help_messageObject



10
11
12
13
14
15
16
# File 'lib/zadt/HelpModules/adt_geometrics_help.rb', line 10

def self.show_hypersphere_help_message
  puts "Here are the methods for HyperSphere:"
  puts "#on?(point)"
  puts "#inside?(point)"
  puts "#outside?(point)"
  puts "#how_far(point)"
end

.show_linkedlist_help_messageObject



3
4
5
6
7
# File 'lib/zadt/HelpModules/adt_linkedlist_help.rb', line 3

def self.show_linkedlist_help_message
  puts "Here are the functions for LinkedListNode:"
  puts "#val"
  puts "#next"
end

.show_minmaxstack_help_messageObject



33
34
35
36
37
38
39
40
41
42
43
# File 'lib/zadt/HelpModules/adt_stackqueue_help.rb', line 33

def self.show_minmaxstack_help_message
  puts "Here are the functions for MinMaxStack:"
  puts "#show"
  puts "#push(value)"
  puts "#pop"
  puts "#peek"
  puts "#min"
  puts "#max"
  puts "#length"
  puts "#empty?"
end

.show_minmaxstackqueue_help_messageObject



45
46
47
48
49
50
51
52
53
54
55
# File 'lib/zadt/HelpModules/adt_stackqueue_help.rb', line 45

def self.show_minmaxstackqueue_help_message
  puts "Here are the functions for MinMaxStackQueue:"
  puts "#show"
  puts "#enqueue(value)"
  puts "#dequeue"
  puts "#peek"
  puts "#min"
  puts "#max"
  puts "#length"
  puts "#empty?"
end

.show_queue_help_messageObject



13
14
15
16
17
18
19
20
21
# File 'lib/zadt/HelpModules/adt_stackqueue_help.rb', line 13

def self.show_queue_help_message
  puts "Here are the functions for Queue:"
  puts "#show"
  puts "#enqueue(value)"
  puts "#dequeue"
  puts "#peek"
  puts "#length"
  puts "#empty?"
end

.show_sphere_help_messageObject



18
19
20
21
22
23
# File 'lib/zadt/HelpModules/adt_geometrics_help.rb', line 18

def self.show_sphere_help_message
  puts "The following methods are specific to a 3-dimensional Sphere:"
  puts "#volume"
  puts "#surface_area"
  puts "#equation, which returns a string in the form of (x-a)^2 + (y-b)^2 + (z-c)^2 = r^2"
end

.show_stack_help_messageObject



3
4
5
6
7
8
9
10
11
# File 'lib/zadt/HelpModules/adt_stackqueue_help.rb', line 3

def self.show_stack_help_message
  puts "Here are the functions for Stack:"
  puts "#show"
  puts "#push(value)"
  puts "#pop"
  puts "#peek"
  puts "#length"
  puts "#empty?"
end

.show_stackqueue_help_messageObject



23
24
25
26
27
28
29
30
31
# File 'lib/zadt/HelpModules/adt_stackqueue_help.rb', line 23

def self.show_stackqueue_help_message
  puts "Here are the functions for StackQueue:"
  puts "#show"
  puts "#enqueue(value)"
  puts "#dequeue"
  puts "#peek"
  puts "#length"
  puts "#empty?"
end

.show_universe_help_messageObject



3
4
5
6
7
8
# File 'lib/zadt/HelpModules/adt_geometrics_help.rb', line 3

def self.show_universe_help_message
  puts "Here are the methods for Universe:"
  puts "#add_point(coordinates)"
  puts "#add_sphere(radius, center)"
  puts "#self.distance(pointA, pointB)"
end