def BFSUtility(obj,visited,vertex):
    """Utility function for Breadth First Search Algorithm."""
    stack = []
    subGraph = []
    stack.insert(0,vertex)
    visited[vertex] = True
    while(stack):
        subGraph.append(stack.pop())
        for nbrVertex in obj.adjList[subGraph[-1]]:
            if visited[nbrVertex]:
                continue
            stack.insert(0,nbrVertex)
            visited[stack[0]] = True
    return subGraph