You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// description: based on `geeksforgeeks` description A Queue is a linear structure which follows a particular order in which the operations are performed.
// The order is First In First Out (FIFO).
// details:
// Queue Data Structure : https://www.geeksforgeeks.org/queue-data-structure/
// Queue (abstract data type) : https://en.wikipedia.org/wiki/Queue_(abstract_data_type)
// author [Milad](https://github.com/miraddo)
// see queuelinkedlist.go, queuelinkedlistwithlist.go, queue_test.go
package queue
varListQueue []any
// EnQueue it will be added new value into our list
funcEnQueue(nany) {
ListQueue=append(ListQueue, n)
}
// DeQueue it will be removed the first value that added into the list
funcDeQueue() any {
data:=ListQueue[0]
ListQueue=ListQueue[1:]
returndata
}
// FrontQueue return the Front value
funcFrontQueue() any {
returnListQueue[0]
}
// BackQueue return the Back value
funcBackQueue() any {
returnListQueue[len(ListQueue)-1]
}
// LenQueue will return the length of the queue list