hi I just wrote a function about the Breadth First Traversal. when i try to compile it,it return a seg fault error, i don't know how can i fix that , can anybody give a hint..
You need to run your program with the debugger, which will show you the line that causes the segmentation fault.
If you use GCC, you also should define _GLIBCXX_DEBUG, which will alert you to any out-of-bounds accesses in a standard container.