diff options
| author | bculkin2442 <bjculkin@mix.wvu.edu> | 2016-04-08 13:28:09 -0400 |
|---|---|---|
| committer | bculkin2442 <bjculkin@mix.wvu.edu> | 2016-04-08 13:28:09 -0400 |
| commit | 275a627719fc2231b16caea41130ff09f0f2b6a1 (patch) | |
| tree | 757e8ca2061ba6ed9b2063f7155edbe954b72bdb /BJC-Utils2/src/main/java/bjc/utils/funcdata/bst/BinarySearchTree.java | |
| parent | 79d3a4a47cbc1fcf17c77c6fc12ff826a3077bac (diff) | |
Switch functional data to use interfaces
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.java | 5 |
1 files changed, 3 insertions, 2 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 fa92f85..67b9985 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 @@ -6,6 +6,7 @@ import java.util.List; import java.util.function.Predicate; import bjc.utils.funcdata.FunctionalList; +import bjc.utils.funcdata.IFunctionalList; import bjc.utils.funcdata.bst.ITreePart.TreeLinearizationMethod; /** @@ -68,7 +69,7 @@ public class BinarySearchTree<T> { * time, but also O(N) space. */ public void balance() { - FunctionalList<T> elements = new FunctionalList<>(); + IFunctionalList<T> elements = new FunctionalList<>(); // Add each element to the list in sorted order rootElement.forEach(TreeLinearizationMethod.INORDER, @@ -123,7 +124,7 @@ public class BinarySearchTree<T> { * The distance from the pivot * @return Whether the adjusted pivot is with the list */ - private boolean adjustedPivotInBounds(FunctionalList<T> elements, + private boolean adjustedPivotInBounds(IFunctionalList<T> elements, int pivot, int pivotAdjustment) { return (pivot - pivotAdjustment) >= 0 && (pivot + pivotAdjustment) < elements.getSize(); |
