Skip to content

Instantly share code, notes, and snippets.

@vamsitallapudi
Created December 18, 2020 15:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vamsitallapudi/eb1d5d2bbc19a555545c1526c685de1d to your computer and use it in GitHub Desktop.
Save vamsitallapudi/eb1d5d2bbc19a555545c1526c685de1d to your computer and use it in GitHub Desktop.
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