Last active
December 23, 2020 03:35
-
-
Save vamsitallapudi/1e0703f7b792b47029db099688d9e2ce to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class TreeNode(var data: Int, var left: TreeNode? = null, var right: TreeNode? = null) | |
fun initializeBinaryTree(): TreeNode { | |
val c = TreeNode(4) | |
val d = TreeNode(5) | |
val a = TreeNode(2, c, d) | |
val b = TreeNode(3) | |
return TreeNode(1, a, b) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment