contestada

 A carpooling club in a suburban city hasnmembers all working at the downtown. They intend to carpool by pairs daily. By the midnight of a day, each member submits his/her departure time interval for the next day.Two members can carpool if their departure intervals overlap. The club then computes a maximum number of carpooling pairs and inform the members about the assignment. Describe anO(nlogn)-time greedy algorithm for finding a maximum number of carpooling pairs. [Hint: Binary-search tree data structures may be used to speed up the algorithm]