Assume you have a computer program called print-EulerCircuit(G) that returns a euler circuit given a graph as an input.
A Euler trail is a walk that hits every edge once in a graph and is not closed.
In pseudocode write a function print-EulerTrail(G) that takes in a graph G and returns a Euler trail.
A connected (isolated vertices are allowed) graph $G$ will have an Euler trail iff it has exactly $2$ vertices with odd degree. In that case, adding an edge between the two odd vertices will make their degrees even, so that now all the vertices have even degrees and the modified graph $G'$ has an Euler circuit.
Assuming $G$ has an Euler trail, locate the $2$ odd vertices and add an edge between them to yield $G'$. Use
getEulerCircuit(G)to find an Euler circuit $C$ in $G'$. Now remove the added edge from $C$, yielding the required Euler trail.