class Zadt::ADT
Public Class Methods
help()
click to toggle source
# File lib/zadt/HelpModules/HelpMessages/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_message()
click to toggle source
# File lib/zadt/HelpModules/HelpMessages/adt_geometrics_help.rb, line 31 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_message()
click to toggle source
# File lib/zadt/HelpModules/HelpMessages/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_message()
click to toggle source
# File lib/zadt/HelpModules/HelpMessages/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_message()
click to toggle source
# File lib/zadt/HelpModules/HelpMessages/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_message()
click to toggle source
# File lib/zadt/HelpModules/HelpMessages/adt_geometrics_help.rb, line 16 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_message()
click to toggle source
# File lib/zadt/HelpModules/HelpMessages/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_message()
click to toggle source
# File lib/zadt/HelpModules/HelpMessages/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_message()
click to toggle source
# File lib/zadt/HelpModules/HelpMessages/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_point_help_message()
click to toggle source
# File lib/zadt/HelpModules/HelpMessages/adt_geometrics_help.rb, line 10 def self.show_point_help_message puts "Here are the methods for Point:" puts "#coords," puts "#dims, the number of dimensions in the coordinates" end
show_queue_help_message()
click to toggle source
# File lib/zadt/HelpModules/HelpMessages/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_message()
click to toggle source
# File lib/zadt/HelpModules/HelpMessages/adt_geometrics_help.rb, line 24 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_message()
click to toggle source
# File lib/zadt/HelpModules/HelpMessages/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_message()
click to toggle source
# File lib/zadt/HelpModules/HelpMessages/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_message()
click to toggle source
# File lib/zadt/HelpModules/HelpMessages/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