Data Structures: Have and Have-nots of Golang

Have

  • arrays

  • slices

  • maps

  • strings

  • structs

  • cahnnels

Have Nots

  • linked lists: build with struct and pointers

  • stacks

  • queues

  • heaps/priority queues

  • trees

  • graphs

  • sets

    s := map[int]bool{5: true, 2: true}
    _, ok := s[6] // check for existence (first return var is 
    s[8] = true // add element 
    delete(s, 2) // remove element

https://stackoverflow.com/questions/34018908/golang-why-dont-we-have-a-set-datastructure

  • hash tables

  • tries

  • deques (double ended)

Last updated