Index
All Classes and Interfaces|All Packages|Constant Field Values|Serialized Form
A
- addEdge(Vertex, Vertex) - Method in class com.thomas.graphs.Unweighted.Graph
-
Adds a directional edge between two vertice
- addEdge(Vertex, Vertex, int) - Method in class com.thomas.graphs.Weighted.Graph
-
Creates a new directional edge between a source vertex and a destination
- addEdge(String, String) - Method in class com.thomas.graphs.DAG.DAG
-
Creates a directional edge from
fromNametotoName.
Both bertices are create automatically if they do not exist - AddEdge(Vertex, int) - Method in class com.thomas.graphs.Weighted.Vertex
-
Adds a new outgoing edge to the Vertex
- addNeighbour(Vertex) - Method in class com.thomas.graphs.DAG.Vertex
-
Adds a neighbour to this vertex
- addNeighbour(Vertex) - Method in class com.thomas.graphs.Unweighted.Vertex
-
Adds a neighbour to the adjacency List
- addUndirectedEdge(Vertex, Vertex) - Method in class com.thomas.graphs.Unweighted.Graph
-
Adds an undirected edge between two vertices
- addVertex(Vertex) - Method in class com.thomas.graphs.Unweighted.Graph
-
Adds a vertex to the graph
- addVertex(Vertex) - Method in class com.thomas.graphs.Weighted.Graph
-
Adds a vertex to the graph
- addVertex(String) - Method in class com.thomas.graphs.DAG.DAG
-
Adds a new vertex to the graph if it is not in the graph
- adjancent - Variable in class com.thomas.graphs.Unweighted.Vertex
-
The adjancancy list of the outgoing neighbours
- AVLNode<T> - Class in com.thomas.trees
-
Simple implemenation of a AVL Tree node
- AVLNode(T) - Constructor for class com.thomas.trees.AVLNode
-
Creates a node without any children
- AVLNode(T, AVLNode, AVLNode) - Constructor for class com.thomas.trees.AVLNode
-
Creates a node with children
- AVLTree<T> - Class in com.thomas.trees
-
A simple implenation of a AVL Tree
- AVLTree() - Constructor for class com.thomas.trees.AVLTree
-
Initializes an Empty AVL
- AVLTree(AVLNode) - Constructor for class com.thomas.trees.AVLTree
-
Initializes an AVL with a root node
B
- balance(AVLNode) - Method in class com.thomas.trees.AVLTree
-
Balances the node such that the balance factor is -1, 0, or 1
- balanceFactor(AVLNode) - Method in class com.thomas.trees.AVLTree
-
Calculates the balance factor of the node
- bellmanFord(Vertex) - Method in class com.thomas.graphs.Weighted.Graph
-
An implemntation of Bellman Ford's algorithm
- bfs(Vertex) - Method in class com.thomas.graphs.Unweighted.Graph
-
An implemnetaion of the breadth-first search algorithm
- BinarySearchTree<T> - Class in com.thomas.trees
-
A simple implentation of a Binaray Search Tree
- BinarySearchTree() - Constructor for class com.thomas.trees.BinarySearchTree
-
Initializes an empty Binary Search Tree
- BinarySearchTree(BTNode) - Constructor for class com.thomas.trees.BinarySearchTree
-
Initializes a Binary search tree with a root node
- BLACK - Enum constant in enum class com.thomas.trees.enums.Colour
-
Black
- BTNode<T> - Class in com.thomas.trees
-
Simple implementation of a Binary Tree Node
- BTNode(T) - Constructor for class com.thomas.trees.BTNode
-
Creates a node with only the data
the left and right node are empty - BTNode(T, BTNode, BTNode) - Constructor for class com.thomas.trees.BTNode
-
Creates a node that has child nodes
C
- Colour - Enum Class in com.thomas.trees.enums
-
The colour for Red Black Trees
- com.thomas.graphs - package com.thomas.graphs
-
This package exists to contain the two types of graphs encountered in CSC2001F
- com.thomas.graphs.DAG - package com.thomas.graphs.DAG
-
The package with the algorithms related to Directional acyclic graphs
- com.thomas.graphs.Unweighted - package com.thomas.graphs.Unweighted
-
The implenation of unweighted graphs
- com.thomas.graphs.Weighted - package com.thomas.graphs.Weighted
-
The implementation of weighted graphs
- com.thomas.trees - package com.thomas.trees
-
The types of Trees and some of their assioated alogorithms encountered in CSC2001F
Trees and Their nodes Binary Search Tree - BTNode AVL Tree - AVLNode RedBlack Tree - RedBlackNode - com.thomas.trees.enums - package com.thomas.trees.enums
-
The ENUMS used for the trees
- compareTo(Vertex) - Method in class com.thomas.graphs.Weighted.Vertex
D
- DAG - Class in com.thomas.graphs.DAG
-
An implemnation of a Directional acyclic graph
- DAG() - Constructor for class com.thomas.graphs.DAG.DAG
-
Creates a new DAG
- delete(AVLNode, T) - Method in class com.thomas.trees.AVLTree
-
Deletes a value from a subtree
- delete(BTNode, T) - Method in class com.thomas.trees.BinarySearchTree
-
Deletes a value from a sub Tree
- delete(RedBlackNode, T) - Method in class com.thomas.trees.RedBlackTree
-
Deletes a value from a subtree
This is not examined - delete(T) - Method in class com.thomas.trees.AVLTree
-
Deletes a value from the tree
- delete(T) - Method in class com.thomas.trees.BinarySearchTree
-
Deletes a value from the tree
- delete(T) - Method in class com.thomas.trees.RedBlackTree
-
Deletes a value from the tree This is not examined
- deleteMin(RedBlackNode) - Method in class com.thomas.trees.RedBlackTree
-
Deletes the minimun node from a subtree
As this is a BST we assume that we can just go left to get the minimum value - dfs(Vertex) - Method in class com.thomas.graphs.Unweighted.Graph
-
An implemnetation of the depth-first search algorithm
- dfsHasCycle(Vertex, Set, Set) - Method in class com.thomas.graphs.DAG.DAG
-
Uses a depth-first search to check for cycles
- dijkstra(Vertex) - Method in class com.thomas.graphs.Weighted.Graph
-
An implemntation of Dijsktra's Algorithm
- dist - Variable in class com.thomas.graphs.Unweighted.Vertex
-
The shortest distance from the source
- distance - Variable in class com.thomas.graphs.Weighted.Vertex
-
The best known distance
E
- Edge - Class in com.thomas.graphs.Weighted
-
A simple Edge class for weighted graphs
- Edge(Vertex, int) - Constructor for class com.thomas.graphs.Weighted.Edge
-
Creates an edge to another vertex
- equals(Object) - Method in class com.thomas.graphs.DAG.Vertex
-
A vertex will be considered equal to another if they have the same name
F
- find(BTNode, T) - Method in class com.thomas.trees.BinarySearchTree
-
Searches a node for a value
- find(T) - Method in class com.thomas.trees.BinarySearchTree
-
Searches the tree for a value
- findMin(AVLNode) - Method in class com.thomas.trees.AVLTree
-
Finds the minimum node in the tree
- findMin(BTNode) - Method in class com.thomas.trees.BinarySearchTree
-
Gets the minimun node of a subtree
- fixAfterDelete(RedBlackNode) - Method in class com.thomas.trees.RedBlackTree
-
Restores Red-Black properties on the way back up after a deletion This is not examined
- fixHeight(AVLNode) - Method in class com.thomas.trees.AVLTree
-
Fixes the height of a node
- flipColours(RedBlackNode) - Method in class com.thomas.trees.RedBlackTree
-
Sets the node to RED and its children to BLACK
G
- getColour() - Method in class com.thomas.trees.RedBlackNode
-
Gets the colour of the node
- getData() - Method in class com.thomas.trees.BTNode
-
Gets the data from this Node
- getHeight() - Method in class com.thomas.trees.AVLNode
-
Gets the height of the node
- getHeight() - Method in class com.thomas.trees.BinarySearchTree
-
Gets the height of the Binary Search Tree
- getLeft() - Method in class com.thomas.trees.AVLNode
-
Gets the left node
- getLeft() - Method in class com.thomas.trees.RedBlackNode
- getParent() - Method in class com.thomas.trees.RedBlackNode
-
Gets the parent of this node
- getRight() - Method in class com.thomas.trees.AVLNode
-
Gets the right node
- getRight() - Method in class com.thomas.trees.RedBlackNode
- getRoot() - Method in class com.thomas.trees.BinarySearchTree
-
Gets the root of the Binary Search Tree
- getSize() - Method in class com.thomas.trees.BinarySearchTree
-
Gets the size of the tree
- getVertex(String) - Method in class com.thomas.graphs.DAG.DAG
-
Gets a vertex with a given name
- getVertices() - Method in class com.thomas.graphs.DAG.DAG
-
Gets all the vertices in the graph
- Graph - Class in com.thomas.graphs.Unweighted
-
An implenation of a graph that does not have weighted edges
- Graph - Class in com.thomas.graphs.Weighted
-
An implenation of a graph that has weighted edges
- Graph() - Constructor for class com.thomas.graphs.Unweighted.Graph
-
Creates an empty graph
- Graph() - Constructor for class com.thomas.graphs.Weighted.Graph
-
Creates an empty graph
- Graph(LinkedList) - Constructor for class com.thomas.graphs.Unweighted.Graph
-
Creates a new graph with vertices
H
- hasCycle() - Method in class com.thomas.graphs.DAG.DAG
-
Checks for cycles in the graph
Uses a depth-first search - hasEdge(String, String) - Method in class com.thomas.graphs.DAG.DAG
-
Checks if
fromNamehas an edge totoName - height(AVLNode) - Method in class com.thomas.trees.AVLTree
-
Gets the height of a node
I
- in_order(BTNode, Consumer) - Method in class com.thomas.trees.BinarySearchTree
-
Uses in-order traversal on a Node
- in_order(Consumer) - Method in class com.thomas.trees.BinarySearchTree
-
Uses in-order traversal on the tree
- INFINITY - Static variable in class com.thomas.graphs.Unweighted.Graph
-
A quick reference for "Infinity"
- INFINITY - Static variable in class com.thomas.graphs.Weighted.Graph
-
A quick reference for "Infinity"
- insert(AVLNode, T) - Method in class com.thomas.trees.AVLTree
-
Inserts a new value into a subtree
- insert(BTNode, T) - Method in class com.thomas.trees.BinarySearchTree
-
Inserts a value into a subtree
- insert(RedBlackNode, T) - Method in class com.thomas.trees.RedBlackTree
-
Inserts a value into a subtree
Also fixes Red-Black violations - insert(T) - Method in class com.thomas.trees.AVLTree
-
Inserts a new value into the Tree
- insert(T) - Method in class com.thomas.trees.BinarySearchTree
-
Inserts a node into the tree
- insert(T) - Method in class com.thomas.trees.RedBlackTree
-
Inserts a value into the tree
- isBlack() - Method in class com.thomas.trees.RedBlackNode
-
Checks if the node is BLACK
- isBlack(RedBlackNode) - Method in class com.thomas.trees.RedBlackTree
-
Returns true if the node is black
- isRed() - Method in class com.thomas.trees.RedBlackNode
-
Checks if the node is RED
- isRed(RedBlackNode) - Method in class com.thomas.trees.RedBlackTree
-
Returns true if the node is red
L
- level_order(BTNode, Consumer) - Method in class com.thomas.trees.BinarySearchTree
-
Uses level-order traversal on a Node
- level_order(Consumer) - Method in class com.thomas.trees.BinarySearchTree
-
Uses level-order traversal on the tree
M
- main(String[]) - Static method in class com.thomas.graphs.Unweighted.TestGraph
-
The main entry point into the script
- moveRedLeft(RedBlackNode) - Method in class com.thomas.trees.RedBlackTree
-
Ensures the left child, or its left child is red before decending left during deletion
- moveRedRight(RedBlackNode) - Method in class com.thomas.trees.RedBlackTree
-
Ensures the right child, or its left child is red before decending right during deletion
N
- name - Variable in class com.thomas.graphs.DAG.Vertex
-
The name of the Vertex
- name - Variable in class com.thomas.graphs.Unweighted.Vertex
-
The name of the vertex
- name - Variable in class com.thomas.graphs.Weighted.Vertex
-
The name of the vertex
- NegativeCycleException - Exception Class in com.thomas.graphs.Weighted
-
A negative weight exception
- NegativeCycleException() - Constructor for exception class com.thomas.graphs.Weighted.NegativeCycleException
-
Defualt constructor
- NegativeCycleException(String) - Constructor for exception class com.thomas.graphs.Weighted.NegativeCycleException
-
Constructor that accepts a custom message
- neighbours - Variable in class com.thomas.graphs.DAG.Vertex
-
The outgoing neighbours of this vertex
- NIL - Variable in class com.thomas.trees.RedBlackTree
-
A Sentinel Null node
Every null point points here instead
O
P
- post_order(BTNode, Consumer) - Method in class com.thomas.trees.BinarySearchTree
-
Uses post-order traversal on a Node
- post_order(Consumer) - Method in class com.thomas.trees.BinarySearchTree
-
Uses post-order traversal on the tree
- pre_order(BTNode, Consumer) - Method in class com.thomas.trees.BinarySearchTree
-
Uses pre-order traversal on a Node
- pre_order(Consumer) - Method in class com.thomas.trees.BinarySearchTree
-
Uses pre-order traversal on the tree
- previous - Variable in class com.thomas.graphs.Unweighted.Vertex
-
The predecessor on the path to the source
- previous - Variable in class com.thomas.graphs.Weighted.Vertex
-
The previous vertex
- printGraph() - Method in class com.thomas.graphs.DAG.DAG
-
Prints the graph to the standard output
R
- recursiveDFS(Vertex) - Method in class com.thomas.graphs.Unweighted.Graph
-
The recusersice defintion of the DFS algorithm
- recursiveHeight(BTNode) - Method in class com.thomas.trees.BinarySearchTree
-
Recursively gets the height of the tree
- recursiveSize(BTNode) - Method in class com.thomas.trees.BinarySearchTree
-
Recursively gets the size of a node
- RED - Enum constant in enum class com.thomas.trees.enums.Colour
-
Red
- RedBlackNode<T> - Class in com.thomas.trees
-
A simple implementation of a Red-Black Tree Node
- RedBlackNode(T) - Constructor for class com.thomas.trees.RedBlackNode
-
Creates a leaf node
- RedBlackNode(T, RedBlackNode, RedBlackNode) - Constructor for class com.thomas.trees.RedBlackNode
-
Creates a node with childre
- RedBlackTree<T> - Class in com.thomas.trees
-
A simple implentation of a Red Black Tree
- RedBlackTree() - Constructor for class com.thomas.trees.RedBlackTree
-
Creates and empty Red-Black Tree
- removeEdge(String, String) - Method in class com.thomas.graphs.DAG.DAG
-
Removes the directional edges from
fromNametotoName - removeMin(BTNode) - Method in class com.thomas.trees.BinarySearchTree
-
Deletes the minimun node from a subtree
- removeNeighbour(Vertex) - Method in class com.thomas.graphs.DAG.Vertex
-
Removes the edge between this vertex and it's neighbour
- removeVertex(String) - Method in class com.thomas.graphs.DAG.DAG
-
Removes the vertex with a given name from the graph, including all of it's edges
- reset() - Method in class com.thomas.graphs.Weighted.Vertex
-
Resets the vertex for running searching algorithms
- restDist() - Method in class com.thomas.graphs.Unweighted.Vertex
-
Resets the distance to the max integer value
- root() - Method in class com.thomas.trees.RedBlackTree
-
Casts the root to a RedBlackNode
- rotateLeft(AVLNode) - Method in class com.thomas.trees.AVLTree
-
Rotates the node left
- rotateLeft(RedBlackNode) - Method in class com.thomas.trees.RedBlackTree
-
Rotates a node left
- rotateRight(AVLNode) - Method in class com.thomas.trees.AVLTree
-
Rotates the node right
- rotateRight(RedBlackNode) - Method in class com.thomas.trees.RedBlackTree
-
Rotates a node right
S
- scractch - Variable in class com.thomas.graphs.Weighted.Vertex
-
A scratch marker
- setColour(Colour) - Method in class com.thomas.trees.RedBlackNode
-
Set the colour of the node
- setData(T) - Method in class com.thomas.trees.BTNode
-
Sets the data of this node
- setHeight(int) - Method in class com.thomas.trees.AVLNode
-
Sets the height of the node
- setParent(RedBlackNode) - Method in class com.thomas.trees.RedBlackNode
-
Set the colour of the node
- setParent(RedBlackNode, RedBlackNode) - Method in class com.thomas.trees.RedBlackTree
-
Sets the parent of a child
Guarding against setting the parent to NIL - setRoot(BTNode) - Method in class com.thomas.trees.BinarySearchTree
-
Sets the root of the tree
T
- TestGraph - Class in com.thomas.graphs.Unweighted
-
An example on how to use the graph
- TestGraph() - Constructor for class com.thomas.graphs.Unweighted.TestGraph
- topologicalSort() - Method in class com.thomas.graphs.DAG.DAG
-
Uses Kahn's alogorithm to sort the graph
- toString() - Method in class com.thomas.graphs.DAG.DAG
- toString() - Method in class com.thomas.graphs.DAG.Vertex
- toString() - Method in class com.thomas.graphs.Unweighted.Vertex
- tragetVertex - Variable in class com.thomas.graphs.Weighted.Edge
-
The target vertex
V
- valueOf(String) - Static method in enum class com.thomas.trees.enums.Colour
-
Returns the enum constant of this class with the specified name.
- values() - Static method in enum class com.thomas.trees.enums.Colour
-
Returns an array containing the constants of this enum class, in the order they are declared.
- Vertex - Class in com.thomas.graphs.DAG
-
A vertex class for a DAG
- Vertex - Class in com.thomas.graphs.Unweighted
-
The vertex class for an unweighted graph
Addapted from the CSC2001F notes - Vertex - Class in com.thomas.graphs.Weighted
-
A simple implentation of a vertex class with weighted edges
- Vertex(String) - Constructor for class com.thomas.graphs.DAG.Vertex
-
Creates a new vertex clasas
- Vertex(String) - Constructor for class com.thomas.graphs.Unweighted.Vertex
-
Creates a new vertex
- Vertex(String) - Constructor for class com.thomas.graphs.Weighted.Vertex
-
Creates a new vertex
- vertices - Variable in class com.thomas.graphs.DAG.DAG
-
The vertices within the graph
- vertices - Variable in class com.thomas.graphs.Unweighted.Graph
-
The vertices in the graph
- vertices - Variable in class com.thomas.graphs.Weighted.Graph
-
The vertices in the graph
- visited - Variable in class com.thomas.graphs.Unweighted.Vertex
-
Has the vertex been visited
- visited - Variable in class com.thomas.graphs.Weighted.Vertex
-
The proccessed flag
W
A B C D E F G H I L M N O P R S T V WAll Classes and Interfaces|All Packages|Constant Field Values|Serialized Form