Question: Please answer the code in C language only not c++, cheers! 3. From the following list of bus rapid transit system (one way): Name Route

Please answer the code in C language only not c++, cheers!

3. From the following list of bus rapid transit system (one way):

Name

Route

Vacation

A->B->C->D

Work 1

E->B->F->G->H

Work 2

B->N->E

Work 3

H->D->N

The problem:

  • Task: Design an algorithm to read the bus rapid transit system routes list and print the number of tickets we need to purchase if we want to visit all places minimal twice. The complexity of the algorithm must be O(V+E). V is the number of places. E-> is the number of transits.
  • PS: Use Tarjans or Kosarajus strongly connected component algorithm.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!