tree.go package tree import ( "fmt" ) type TreeNode struct { ID int Val int Left *TreeNode Right *TreeNode } func PreOrder(root *TreeNode) { if root != nil { fmt.Printf("%d ", root.Val) PreOrder(root.Left) PreOrder(root.Right) } } func…
ArrayList是java最重要的数据结构之一,日常工作中经常用到的就是ArrayList的遍历,经过总结,发现大致有三种,上代码: package com.company; import java.util.ArrayList; import java.util.Iterator; import java.util.List; /** * Created by wangbin10 on 2017/3/1. */ public class JavaSort { public static vo…