The following is the given algorithm for finding a Euler Path in a Eulerian Graph. However, it is said that there is an counter example with less than 10 vertices. The given Eulerian Graph is undirected and every vertex has even degree and it will start and end at the same vertex.
1. Perform a DFS traversal of G and number the vertices in DFS-preorder.
2. Re-initialize all vertices and edges of G as unused.
3. Produce a cycle as follows:
Start from the vertex with preorder number 1 (computed in step 1), and
repeatedly go to the vertex with highest preorder number possible along
an unused edge.
Stop when all edges incident to the current vertex are used.
I have been trying vertices from 6 to 9 for the last 3 days and I really couldn't come up with one example. Any help is appreciated! Thank you.

C A B D ENow asCis node number 1 we will start from it and will have to visit it again to go to other cycle. Similar examples with 2 or more cycles with common node will give error if what i understood of your code is correct.