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
if array.count > 50 && percentage > 0.25 {
array.removeFirst(head)
head = 0
}
If the condition happens, the complexity will be O(n/4) ~ O(n)
I think you should use LinkedList to implement a Queue to archive O(1) in all cases of dequeue