MCPcopy Create free account
hub / github.com/careercup/ctci / IsEmpty

Method IsEmpty

go/chapter04/queue/queue.go:126–137  ·  view source on GitHub ↗

Returns false if the queue is empty i. e function used to identify whether the queue is empty

()

Source from the content-addressed store, hash-verified

124//Returns false if the queue is empty
125//i. e function used to identify whether the queue is empty
126func (q *Queue) IsEmpty() bool {
127 q.lock.Lock()
128 defer q.lock.Unlock()
129
130 if q == nil {
131 return false
132 }
133 if q.count == 0 {
134 return true
135 }
136 return false
137}
138
139func main() {
140

Callers 2

mainFunction · 0.45
isPathAvailableFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected