Share Link
Copied to clipboard
Embed on Your Page
Copied to clipboard
We Stand with Ukraine
Queue: More Examples by Codebuns Sample Code
---------Enqueue() : To add items---------
A
B
C
D
E

---------Peek() : To get first item---------
A

---------Contains() : Check and return Boolean if B exists in the collection---------
True

---------Count : To get total items---------
5

---------Dequeue() : To remove first item---------
A

Total items in collection : 4

---------Return removed items from queue using While loop---------
B
C
D
E

Total items in collection : 0


---------Clear() : Remove all the items---------

Total items in collection before Clear() : 3

Total items in collection after Clear() : 0
Cached Result
Last Run: 10:28:27 am
Compile: 0.377s
Execute: 0.006s
Memory: 8kb
CPU: 0.141s