摘要: type node struct { data int lchild *node rchild *node } func newNode(data int) *node { return &node{data: data} } type binaryTree struct { root *node 阅读全文
posted @ 2020-06-14 17:32 花名k 阅读(160) 评论(0) 推荐(0)
摘要: func merge(left,right []int) (result []int) { r,l := 0,0 for l < len(left) && r < len(right) { if left[l] < right[r]{ result = append(result,left[l]) 阅读全文
posted @ 2020-06-14 17:29 花名k 阅读(186) 评论(0) 推荐(0)
摘要: package main import ( "fmt" ) type ListNode struct{ data int next *ListNode } func NewListNode(data int) *ListNode{ return &ListNode{data:data} } type 阅读全文
posted @ 2020-06-14 17:27 花名k 阅读(152) 评论(0) 推荐(0)