This is not a linked-list question; it's a graph theory question.
A graph is mathematically defined as a set of vertices, and a set of edges, which are pairs of vertices that are defined as "adjacent". The edges can also be defined to be directed (such is the case in your scenario).
A path in a graph is a sequence of vertices such that there is an edge from each of the vertices to the next vertex in the sequence.
Adjacency relationship are commonly represented in one of two ways: adjacency matrix (a simple 2D array), or an adjacency list (which uses a linked list), but problems and solutions can be defined regardless of representation (though it does have an effect on complexity).
The shortest path problem, for example, assigns weights to the edges, and require a path between two nodes whose total weight is minimized. The classic solution taught in computer science course is Dijkstra's algorithm.
Most good algorithm books have a chapter on elementary graph theory.
Having said all that, there is a special kind of graph that is called a path graph, which may be what your input graph is (it can only be confirmed once all the assumptions of the problems are made explicit). If your input graph is of this simple type, then an easy solution to your problem exists (see danben's answer).
I will present the same algorithm in pseudocode form:
LET pred BE a MAP City=>City // "predecessor"
LET succ BE a MAP City=>City // "successor"
// build pred and succ
FOR EACH Ticket(City A, City B) DO
pred[B] = A
succ[A] = B
// find the starting city, i.e. one that doesn't have a pred
LET C BE any City
WHILE pred[C] != NULL
C = pred[C]
// keep going until you reach the end
WHILE C != NULL
PRINT C
C = succ[C]
With a good MAP
implementation, this is O(N)
where N
is the number of tickets.