Skip to content

Instantly share code, notes, and snippets.

View rrain7's full-sized avatar
😞
sad

rrain7 rrain7

😞
sad
View GitHub Profile
@rrain7
rrain7 / postorder.go
Last active August 10, 2021 14:48
δΊŒε‰ζ ‘εŽεΊιεŽ†
func postorderTraversal(root *TreeNode) []int {
result := []int{}
processNode := func(node *TreeNode) {
result = append(result, node.Val)
}
postorder(root, processNode)
return result
}
@rrain7
rrain7 / inorder.go
Created August 8, 2021 15:04
δΊŒε‰ζ ‘δΈ­εΊιεŽ†
func inorderTraversal(root *TreeNode) []int {
result := []int{}
processNode := func(node *TreeNode) {
result = append(result, node.Val)
}
inorder(root, processNode)
return result
}
@rrain7
rrain7 / preOrder.go
Last active August 8, 2021 13:03
preOrder.go
type TreeNode struct {
Val int
Left *TreeNode
Right *TreeNode
}
func preorderTraversal(root *TreeNode) []int {
result := []int{}