From 42f7d379a430aaf2fad169f0170de04072b08b10 Mon Sep 17 00:00:00 2001 From: bculkin2442 Date: Fri, 22 Apr 2016 14:48:04 -0400 Subject: Formatting changes --- .../bjc/utils/funcdata/bst/BinarySearchTree.java | 34 +++++++++++----------- 1 file changed, 17 insertions(+), 17 deletions(-) (limited to 'BJC-Utils2/src/main/java/bjc/utils/funcdata/bst/BinarySearchTree.java') 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 @@ -63,6 +63,23 @@ public class BinarySearchTree { } } + /** + * 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 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. @@ -112,23 +129,6 @@ public class BinarySearchTree { } } - /** - * 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 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 -- cgit v1.2.3