Queue (C#)

0.0(0)
Studied by 0 people
call kaiCall Kai
Locked
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/19

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 3:59 AM on 8/14/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai
Chat

No analytics yet

Send a link to your students to track their progress

20 Terms

1
New cards

Queue

A generic collection in System.Collections.Generic that stores elements for first-in, first-out (FIFO) processing. Domain: C# → .NET → System.Collections.Generic → Queue

2
New cards

FIFO

First In, First Out; the element that has been waiting in the Queue the longest is the next element removed.

3
New cards

Front of a Queue

The end of a Queue from which the next element is inspected or removed.

4
New cards

Back of a Queue

The end of a Queue where newly enqueued elements are added.

5
New cards

new Queue()

Creates an empty Queue.

6
New cards

new Queue(collection)

Creates a Queue containing elements copied from the specified collection in enumeration order.

7
New cards

queue.Count

Gets the number of elements currently contained in the Queue.

8
New cards

queue.Enqueue(item)

Adds an element to the back of the Queue.

9
New cards

queue.Dequeue()

Removes and returns the element at the front of the Queue; throws InvalidOperationException if the Queue is empty.

10
New cards

queue.Peek()

Returns the element at the front of the Queue without removing it; throws InvalidOperationException if the Queue is empty.

11
New cards

queue.TryDequeue(out result)

Attempts to remove and return the element at the front of the Queue, returning false if the Queue is empty.

12
New cards

queue.TryPeek(out result)

Attempts to return the element at the front of the Queue without removing it, returning false if the Queue is empty.

13
New cards

queue.Contains(item)

Determines whether the specified element occurs in the Queue.

14
New cards

queue.Clear()

Removes all elements from the Queue.

15
New cards

queue.ToArray()

Copies the Queue elements into a new array in FIFO order.

16
New cards

queue.TrimExcess()

Reduces excess internal storage capacity when appropriate relative to the number of elements currently stored.

17
New cards

Enqueue vs Dequeue

Enqueue adds an element to the back of a Queue, whereas Dequeue removes and returns an element from the front.

18
New cards

Dequeue vs Peek

Dequeue returns and removes the front element, whereas Peek returns the front element without removing it.

19
New cards

TryDequeue vs Dequeue

TryDequeue safely reports failure when the Queue is empty, whereas Dequeue throws an InvalidOperationException.

20
New cards

Queue vs List

Queue is designed for FIFO processing through its front and back, whereas List is designed around ordered storage and zero-based indexed access.