style: format code (#4212)

close #4204
This commit is contained in:
acbin
2023-06-09 18:52:05 +08:00
committed by GitHub
parent ad03086f54
commit 00282efd8b
521 changed files with 5233 additions and 7309 deletions

View File

@ -4,25 +4,25 @@ import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
public class LeftistHeapTest {
@Test
void testLeftistHeap() {
LeftistHeap heap = new LeftistHeap();
Assertions.assertTrue(heap.isEmpty());
heap.insert(6);
Assertions.assertTrue(!heap.isEmpty());
heap.insert(2);
heap.insert(3);
heap.insert(1);
heap.in_order();
Assertions.assertTrue(heap.in_order().toString().equals("[6, 2, 3, 1]"));
Assertions.assertTrue(heap.extract_min() == 1);
Assertions.assertTrue(heap.in_order().toString().equals("[6, 2, 3]"));
heap.insert(8);
heap.insert(12);
heap.insert(4);
Assertions.assertTrue(heap.in_order().toString().equals("[8, 3, 12, 2, 6, 4]"));
heap.clear();
Assertions.assertTrue(heap.isEmpty());
}
@Test
void testLeftistHeap() {
LeftistHeap heap = new LeftistHeap();
Assertions.assertTrue(heap.isEmpty());
heap.insert(6);
Assertions.assertTrue(!heap.isEmpty());
heap.insert(2);
heap.insert(3);
heap.insert(1);
heap.in_order();
Assertions.assertTrue(heap.in_order().toString().equals("[6, 2, 3, 1]"));
Assertions.assertTrue(heap.extract_min() == 1);
Assertions.assertTrue(heap.in_order().toString().equals("[6, 2, 3]"));
heap.insert(8);
heap.insert(12);
heap.insert(4);
Assertions.assertTrue(heap.in_order().toString().equals("[8, 3, 12, 2, 6, 4]"));
heap.clear();
Assertions.assertTrue(heap.isEmpty());
}
}