Skip to content

Instantly share code, notes, and snippets.

@vamsitallapudi
Created December 22, 2020 13:21
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/fa9d2e89d13c901428da8c4b845104b4 to your computer and use it in GitHub Desktop.
Save vamsitallapudi/fa9d2e89d13c901428da8c4b845104b4 to your computer and use it in GitHub Desktop.
fun postOrderRecursive(root: TreeNode?) : List<Int>{
if(root == null) return emptyList()
return postOrderRecursive(root.left) + postOrderRecursive(root.right) + listOf(root.data)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment