Menu

[solved] – Question 94147

Use AVL tree.
Topic: Cars on a National Highway
Consider a national highway H, which goes in a straight line and has two-
way traffic. Further, vehicles can enter or leave the highway through the various
side roads joining it.
The location of a vehicle on the highway at any given instant of time is given
by a unique real number in the range R. Further, the current time curr
takes increasing, positive real values starting from initial value of 0. All vehicles
on the highway travel at the uniform speed of 1 unit distance per 1 unit time.
Each vehicle has a unique registration number, which we take to be a non-
negative integer value for the purposes of this assignment.
You have to implement a data structure, which maintains the state of the
highway in a suitable format, and answers queries about its traffic.

Expert Answer


OR


Leave a Reply

Your email address will not be published. Required fields are marked *