kota's memex

arrays

A series in memory of items which are all the same size and type.

Each item is the same size, so jumping to an arbitrary location is fast (constant).

a := []int{1, 2, 3}

linked list

An item which has a pointer to the next item in the list. Each item can be different sizes and expanding the list is trivial.

However, jumping to an arbitrary location means looping over the list (linear time).

type node struct {
  data int
  next *node
}

list := &node{data: 1}

hash map

tree

stack

queue