Skip to content

Latest commit

 

History

History
47 lines (27 loc) · 1.61 KB

README.md

File metadata and controls

47 lines (27 loc) · 1.61 KB

Golang Algorithm

This repository stores some Data Structures and Alogorithms implemented with Golang.

Finished data structures in 2017.4.18

Finished sort-algorithms in 2017.4.19

Finished search-algorithms in 2017.4.25

My search/sort algorithms implemented by C language can refer to the following:

Reference:


  1. 数组slicemap的底层结构

  2. slice是Go里面惯用的集合数据的方法,map则是用来存储键值对

  3. 内建函数make用来创建slicemap,并且为它们指定长度和容量等等。slice和map`字面值也可以做同样的事

  4. slice容量约束,不过可以通过内建函数append来增加元素

  5. map没有容量一说,所以也没有任何增长限制

  6. 内建函数len可以用来获得slicemap的长度

  7. 内建函数cap只能作用在slice

  8. 可以通过组合方式来创建多维数组和slicemap的值可以是slice或者另一个mapslice不能作为map的键

  9. 在函数之间传递slicemap是相当廉价的,因为他们不会传递底层数组的拷贝


Go的container包自带了三种数据结构:双向链表双向循环链表

具体使用可以参看这里