Created
December 18, 2020 15:05
-
-
Save vamsitallapudi/eb1d5d2bbc19a555545c1526c685de1d 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
fun inOrderTraversalRecursive(root: TreeNode?) : List<Int> { | |
if (root == null) return emptyList() | |
return inOrderTraversalRecursive(root.left) + listOf(root.data) + inOrderTraversalRecursive(root.right) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment