11package com .thealgorithms .datastructures .trees ;
22
3- import org .junit .jupiter .api .Test ;
3+ import static org .junit .jupiter .api .Assertions . assertEquals ;
44
55import java .util .Collections ;
66import java .util .List ;
77
8- import static org .junit .jupiter .api .Assertions . assertEquals ;
8+ import org .junit .jupiter .api .Test ;
99
1010/**
1111 *
@@ -39,9 +39,7 @@ public void testSingleNodeTree() {
3939 */
4040 @ Test
4141 public void testCompleteBinaryTree () {
42- final BinaryTree .Node root = TreeTestUtils .createTree (new Integer []{
43- 1 , 2 , 3 , 4 , 5 , 6 , 7
44- });
42+ final BinaryTree .Node root = TreeTestUtils .createTree (new Integer [] {1 , 2 , 3 , 4 , 5 , 6 , 7 });
4543
4644 List <Integer > expected = List .of (1 , 2 , 4 , 5 , 6 , 7 , 3 );
4745
@@ -64,9 +62,7 @@ public void testCompleteBinaryTree() {
6462 */
6563 @ Test
6664 public void testBoundaryTraversal () {
67- final BinaryTree .Node root = TreeTestUtils .createTree (new Integer []{
68- 1 , 2 , 7 , 3 , null , null , 8 , null , 4 , 9 , null , 5 , 6 , 10 , 11
69- });
65+ final BinaryTree .Node root = TreeTestUtils .createTree (new Integer [] {1 , 2 , 7 , 3 , null , null , 8 , null , 4 , 9 , null , 5 , 6 , 10 , 11 });
7066
7167 List <Integer > expected = List .of (1 , 2 , 3 , 4 , 5 , 6 , 10 , 11 , 9 , 8 , 7 );
7268
@@ -85,7 +81,7 @@ public void testBoundaryTraversal() {
8581 */
8682 @ Test
8783 public void testLeftSkewedTree () {
88- final BinaryTree .Node root = TreeTestUtils .createTree (new Integer []{1 , 2 , null , 3 , null , 4 , null });
84+ final BinaryTree .Node root = TreeTestUtils .createTree (new Integer [] {1 , 2 , null , 3 , null , 4 , null });
8985
9086 List <Integer > expected = List .of (1 , 2 , 3 , 4 );
9187
@@ -104,7 +100,7 @@ public void testLeftSkewedTree() {
104100 */
105101 @ Test
106102 public void testRightSkewedTree () {
107- final BinaryTree .Node root = TreeTestUtils .createTree (new Integer []{5 , null , 6 , null , 7 , null , 8 });
103+ final BinaryTree .Node root = TreeTestUtils .createTree (new Integer [] {5 , null , 6 , null , 7 , null , 8 });
108104
109105 List <Integer > expected = List .of (5 , 6 , 7 , 8 );
110106
0 commit comments