Hi
I am developing a program that uses Breadth First Search to map a grid(2d array) out. Breadth First Search involves storing nodes in a stack and then exploring these nodes based on Breadth or level. I know how to create a vector array which I shall use as a stack. I need to know how to store array elements in the stack using the
push_back()
method. This is what I have so far..
vector<int>stack; //stack initialization.
stack.push_back(array[1][1]) //store array element itself, not Value held in array!
The value stored is not the array element, but the value which happens to be some integer x.
Thanks for helping.