Compare commits
3 Commits
450f1f6b5d
...
7f6439ce7c
Author | SHA1 | Date | |
---|---|---|---|
7f6439ce7c | |||
41aa639602 | |||
146b33a651 |
@ -1,3 +1,6 @@
|
|||||||
|
<<<<<<< HEAD
|
||||||
|
import TreeNode from '../../test/tree/TreeNode'
|
||||||
|
=======
|
||||||
/**
|
/**
|
||||||
* Definition for a binary tree node.
|
* Definition for a binary tree node.
|
||||||
*/
|
*/
|
||||||
@ -6,6 +9,7 @@ function TreeNode(val) {
|
|||||||
this.left = this.right = null
|
this.left = this.right = null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
>>>>>>> 450f1f6b5d96df43627b7b8c07518b2ec772a2da
|
||||||
/**
|
/**
|
||||||
* @param {number[]} nums
|
* @param {number[]} nums
|
||||||
* @return {TreeNode}
|
* @return {TreeNode}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { sortedArrayToBST } from '../../src/tree/convert-sorted-array-to-binary-search-tree.js'
|
import { sortedArrayToBST } from '../../src/tree/convert-sorted-array-to-binary-search-tree.js'
|
||||||
|
|
||||||
test('将有序数组转换为二叉搜索树', () => {
|
test('将有序数组转换为二叉搜索树', () => {
|
||||||
expect(sortedArrayToBST()).toEqual()
|
expect(sortedArrayToBST([-10, -3, 0, 5, 9])).toEqual({ left: { left: null, right: { left: null, right: null, val: -3 }, val: -10 }, right: { left: null, right: { left: null, right: null, val: 9 }, val: 5 }, val: 0 })
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user