We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 46cdb7e commit fda9792Copy full SHA for fda9792
src/me/ramswaroop/linkedlists/SortedDLLToBBST.java
@@ -29,6 +29,13 @@ static <E extends Comparable<E>> void inOrder(DoubleLinkedNode<E> node) {
29
inOrder(node.next);
30
}
31
32
+ /**
33
+ * Converts a sorted doubly linked list to a balanced binary tree in-place.
34
+ *
35
+ * @param node
36
+ * @param <E>
37
+ * @return
38
+ */
39
public static <E extends Comparable<E>> DoubleLinkedNode<E> sortedSLLToBBST(DoubleLinkedNode<E> node) {
40
return sortedSLLToBBST(node, getLength(node));
41
0 commit comments