MCPcopy Index your code
hub / github.com/TheAlgorithms/Go / isInQueue

Method isInQueue

project_euler/problem_18/tree.go:222–229  ·  view source on GitHub ↗

isInQueue is a method that avoids duplicates in the tree

(nv int)

Source from the content-addressed store, hash-verified

220
221// isInQueue is a method that avoids duplicates in the tree
222func (n *Tree) isInQueue(nv int) bool {
223 if _, ok := n.Nodes[nv]; ok {
224 return true
225 }
226
227 n.Nodes[nv] = struct{}{}
228 return false
229}

Callers 3

BFSInsertMethod · 0.95
PrintReportMethod · 0.95
PrintPyramidMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected