- Fork and clone this repository.
- Change into the new directory.
- Create and checkout a new branch to work on.
- Write your code in
lib/atc.js
- Fulfill the listed requirements.
A software subsystem of an air-traffic control system is defined to manage a
queue of aircraft (AC) in an airport. Write a constructor function, AtcQueue
,
that creates an aircraft queue.
The aircraft queue is managed by a process which responds to three types of requests:
- Enqueue aircraft used to insert a new AC into the system.
enqueue
- Dequeue aircraft used to remove an AC from the system.
dequeue
- AircraftCount used to count the aircraft in the queue.
aircraftCount
AC have at least (but are not limited to having) the following properties:
- AC
type
: passenger or cargo. - AC
size
: small or large.
The process which manages the queue of AC satisfies the following:
- There is no limit on the number of AC it can manage.
- Dequeue aircraft requests result in selection of one AC for removal such
that:
- Passenger AC have removal precedence over Cargo AC.
- Large AC of a given type have removal precedence over Small AC of the same type.
- Earlier enqueued AC of a given type and size have precedence over later enqueued AC of the same type and size.
Use grunt test
to test your code.
- All content is licensed under a CCBYNCSA 4.0 license.
- All software code is licensed under GNU GPLv3. For commercial use or alternative licensing, please contact legal@ga.co.