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 7019524 commit 953db7eCopy full SHA for 953db7e
insert-into-a-binary-search-tree/TreeNode.kt
@@ -0,0 +1,3 @@
1
+package masx200.leetcode_test.insert_into_a_binary_search_tree
2
+
3
+class TreeNode(var `val`: Int = 0, var left: TreeNode? = null, var right: TreeNode? = null)
insert-into-a-binary-search-tree/index.kt
@@ -1,7 +1,5 @@
package masx200.leetcode_test.insert_into_a_binary_search_tree
-class TreeNode(var `val`: Int = 0, var left: TreeNode? = null, var right: TreeNode? = null) {}
4
-
5
class Solution {
6
fun insertIntoBST(root: TreeNode?, `val`: Int): TreeNode? {
7
if (root == null) return TreeNode(`val`)
0 commit comments