Abstract Data Structures
Topic 5 : Abstract Data Structures
Questions Attempted 0/1
Abstract Data Structures
Available time 20 Minute(s)
01

In a small airport, the details of all flights due to arrive on a particular day are held in a collection, FLIGHTS.

Topic 5 : Abstract Data Structures
:
Available time 20 Minute(s)
01. Question
Level Hard
Maximum Mark 15
Report a bug
Tell us how we can help

In a small airport, the details of all flights due to arrive on a particular day are held in a collection, FLIGHTS. Each object in the collection contains the following information:

  • ID: unique flight number
  • PLACE: where the plane is coming from
  • DUE: the time it is scheduled to arrive
  • EXPECTED: the time it is expected to arrive (only if it is early or if it is delayed)
  • ARRIVED: the time of actual arrival.
  • EXPECTED and ARRIVED are blank at the beginning of the day and the collection is sorted in order of DUE.

A screen in the airport can display information on 20 planes at a time, which are held in a linked list

(a) Describe the features of a linked list of 20 planes that have the above information.

 

[Marks: 3]

All times are stored in the collection as the number of minutes since midnight. However they are displayed on the screen in 24-hour format (for example, 10:58 is stored in the collection as 658)

(b) Construct an algorithm to convert the times held in the collection into hours and minutes needed for the 24-hour format displayed on the screen.

[Marks: 3]

If a plane arrived more than 30 minutes ago it is removed from the linked list and the next one in the collection is added to the end of the list.

(c) With the aid of a diagram, explain how a plane which arrived more than 30 minutes ago could be removed from the linked list.

[Marks: 4]

(d) For the application described above, compare the use of a linked list with the use of a queue of objects. 

[Marks: 5]
Loading...