test for BFS, connected graph creation for Undirected case, tested subclassing and fixed typecasting issue for subclassing