Q:

Graph Theory Depth First Search

While implementing DFS traversal using stacks, do we need to push the element into the stack if it's already inside the stack but not visited? 

A:

Do we need to push the element into the stack if it's already inside
  the stack but not visited?

The answer is no, because it's one way to go into loops..
If you are traversing a Graph using Depth-First Search, you are likely to get caught in loops..
The best way to avoid that problem is using a Taboo List, which keeps the IDs of all visited nodes..
stack.push(init);

while (!stack.empty())
{
    current = stack.pop();
    taboo.add(current.id);

    if (isGoal(current))
    {
        break;
    }

    for (Node neighbor : getNeighbors(current))
    {
        if (!taboo.contains(neighbor.id))
        {
            stack.push(neighbor);
        }
    }

}

