type NodeStack … // Len returns the number of graph.Nodes on the stack. func (s *NodeStack) Len() int { … } // Pop returns the last graph.Node on the stack and removes it // from the stack. func (s *NodeStack) Pop() graph.Node { … } // Push adds the node n to the stack at the last position. func (s *NodeStack) Push(n graph.Node) { … } type NodeQueue … // Len returns the number of graph.Nodes in the queue. func (q *NodeQueue) Len() int { … } // Enqueue adds the node n to the back of the queue. func (q *NodeQueue) Enqueue(n graph.Node) { … } // Dequeue returns the graph.Node at the front of the queue and // removes it from the queue. func (q *NodeQueue) Dequeue() graph.Node { … } // Reset clears the queue for reuse. func (q *NodeQueue) Reset() { … }