1. Does space complexity includes both input space and extra space needed for algorithm or only extra space?
2.What will be Space complexity for BFS algorithm with adjacency matrix representation? Please reply with supporting references.
So in case of adjacency matrix space complexity of BFS should be O(n) but in wiki it is given O(n2)?
In d link mentioned below. Yeah. :)