1. Course
  2. Generic collections
  3. Queue with arrays

Queue with arrays


Last updated: 8/23/2020 Difficulty: Intermediate

Create a C# program that simulates the operation of a queue using an array of integers. There will be a class called Queue with 2 properties, an array of integers and an integer to store the current position of the queue values.

The queue must have a constructor where the size of the queue will be specified per parameter and two methods, one for Enqueue() and the other for Unenqueue() the values. Remember that the new values are glued at the end and the first ones are descoiled.

To test, create a Queue object in the program's Main and try to queue and unqueue some values.

Input


                    
                    

Output



                    

Solution

Generic collections

2 / 5

Android App


Practice C# anywhere with the free app for Android devices.

Android App

Exercises C# by difficulty


Learn C# at your own pace, the exercises are ordered by difficulty.

Advertising