Update Dart code to output same as Java (#522)

This commit is contained in:
liuyuxin
2023-05-30 13:00:16 +08:00
committed by GitHub
parent 5bbcb12979
commit 8247a611d7
14 changed files with 47 additions and 42 deletions

View File

@ -75,14 +75,14 @@ void quadratic(int n) {
int quadraticRecur(int n) {
if (n <= 0) return 0;
List<int> nums = List.filled(n, 0);
print('递归 n = $n 中的长度 nums 长度 = ${nums.length}');
print('递归 n = $n 中的 nums 长度 = ${nums.length}');
return quadraticRecur(n - 1);
}
/* 指数阶(建立满二叉树) */
TreeNode? buildTree(int n) {
if (n == 0) return null;
TreeNode root = TreeNode(n);
TreeNode root = TreeNode(0);
root.left = buildTree(n - 1);
root.right = buildTree(n - 1);
return root;