/// <summary> /// Enqueues <paramref name="x"/> into hashqueue. /// </summary> public void Enqueue(T x) { x.ThrowIfArgumentNull(nameof(x)); if (!map.TryGetValue(x, out Deque <Node <T> > nodeq)) { nodeq = new Deque <Node <T> >(); map[x] = nodeq; } nodeq.Enqueue(dq.Enqueue(x)); }
public static IDeque ConcatenateIDeque(IDeque a, IDeque b) { // create new deque as a copy of a IDeque newDeque = (IDeque)Activator.CreateInstance(a.GetType(), a); // then append b foreach (object entry in b) { newDeque.Enqueue(entry); } return(newDeque); }
/// <inheritdoc /> public void Enqueue(T item) { _deque.Enqueue(item); }