I am learning basic data structures and I chose golang  since it  provide C 
like pointers. While looking at list.go I noticed this in the Element struct


type Element {
next, prev *Element //makes sense. Doubly linked list
list *List //Why! I don't understand why there is a pointer to List
Value interface{} //makes sense. Data interface
}

Source: https://github.com/golang/go/blob/master/src/container/list/list.go

 

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to