一些数据结构小抄本文最后更新于:2022年11月16日 晚上数据结构小抄,Go语言实现,用于面试快速书写算法 一些数据结构小抄 最小堆123456789101112type hp struct{ sort.IntSlice }func (h *hp) Push(v interface{}) { h.IntSlice = append(h.IntSlice, v.(int))}func (h *hp) Pop() interface{} { a := h.IntSlice v := a[len(a)-1] h.IntSlice = a[:len(a)-1] return v} leetcode leetcode本博客所有文章除特别声明外,均采用 CC BY-SA 4.0 协议 ,转载请注明出处! 最大子数组和 上一篇操作系统笔记 下一篇 Please enable JavaScript to view the comments