Let us learn some golang via data structures
-
Why is the golang linked list unencapsulated, i.e. why are Elements programatically accessible? Ideas: Collapses both datum and iterator into the same struct, to help avoid repeated traversals when accessing the list in a sequence of operations.
-
Next: a fully encapsulated, singly-linked list with:
- O(1) Append
- O(1) Concat (in place, obviously)
- O(m+n) CopyConcat
- O(n) Search
- O(n) Remove (nil if failed)