summaryrefslogtreecommitdiff
path: root/BJC-Utils2/src/main/java/bjc/utils/funcdata/bst/BinarySearchTree.java
diff options
context:
space:
mode:
authorbculkin2442 <bjculkin@mix.wvu.edu>2016-04-22 14:48:04 -0400
committerbculkin2442 <bjculkin@mix.wvu.edu>2016-04-22 14:48:04 -0400
commit42f7d379a430aaf2fad169f0170de04072b08b10 (patch)
tree5d46b43b2d9272f4e593820ee147b3ae3f0d82b0 /BJC-Utils2/src/main/java/bjc/utils/funcdata/bst/BinarySearchTree.java
parentb65b705c391bb772bc41269bce5243c1cc88969d (diff)
Formatting changes
Diffstat (limited to 'BJC-Utils2/src/main/java/bjc/utils/funcdata/bst/BinarySearchTree.java')
-rw-r--r--BJC-Utils2/src/main/java/bjc/utils/funcdata/bst/BinarySearchTree.java34
1 files changed, 17 insertions, 17 deletions
diff --git a/BJC-Utils2/src/main/java/bjc/utils/funcdata/bst/BinarySearchTree.java b/BJC-Utils2/src/main/java/bjc/utils/funcdata/bst/BinarySearchTree.java
index c147646..712f0e3 100644
--- a/BJC-Utils2/src/main/java/bjc/utils/funcdata/bst/BinarySearchTree.java
+++ b/BJC-Utils2/src/main/java/bjc/utils/funcdata/bst/BinarySearchTree.java
@@ -64,6 +64,23 @@ public class BinarySearchTree<T> {
}
/**
+ * Check if an adjusted pivot falls with the bounds of a list
+ *
+ * @param elements
+ * The list to get bounds from
+ * @param pivot
+ * The pivot
+ * @param pivotAdjustment
+ * The distance from the pivot
+ * @return Whether the adjusted pivot is with the list
+ */
+ private boolean adjustedPivotInBounds(IFunctionalList<T> elements,
+ int pivot, int pivotAdjustment) {
+ return (pivot - pivotAdjustment) >= 0
+ && (pivot + pivotAdjustment) < elements.getSize();
+ }
+
+ /**
* Balance the tree, and remove soft-deleted nodes for free. Takes O(N)
* time, but also O(N) space.
*/
@@ -113,23 +130,6 @@ public class BinarySearchTree<T> {
}
/**
- * Check if an adjusted pivot falls with the bounds of a list
- *
- * @param elements
- * The list to get bounds from
- * @param pivot
- * The pivot
- * @param pivotAdjustment
- * The distance from the pivot
- * @return Whether the adjusted pivot is with the list
- */
- private boolean adjustedPivotInBounds(IFunctionalList<T> elements,
- int pivot, int pivotAdjustment) {
- return (pivot - pivotAdjustment) >= 0
- && (pivot + pivotAdjustment) < elements.getSize();
- }
-
- /**
* Soft-delete a node from the tree. Soft-deleted nodes stay in the
* tree until trim()/balance() is invoked, and are not included in
* traversals/finds.