Yeah, my mistake - I got confused between a queue and a stack. DFS uses a stack.
The output is supposed to be: 2 3 4 5 6 7 8
If there is an edge from vertex 4 to vertex 1, then 1 should be traversed.
Notwithstanding the fact that 1 isn't traversed when it should be, simply drawing the graph indicates that the sequence 5 6 7 8 in the expected output is most certainly not breadth-order, so either you're interpreting the graph incorrectly or the expected output is wrong. Someone else should check this, too - I'm tired today.
vector<int> *adj;
//...
adj = new vector<int>[num_vertices];
//...
adj[vertice].push_back(adjacent);
so variable adj is a pointer to std::vector<int> that is allocated dynamically. So far so good but then what does the last statement mean? adj[vertice] is a std::vector<int> by itself as push_back() is defined in relation to it?