| | |
problem implementing BFS using string vector
![]() |
•
•
Join Date: Sep 2007
Posts: 1
Reputation:
Solved Threads: 0
Hi All,
The problem is that i have to read in a text file which is something like:
ASt BSt
BSt WSt
BSt YeSt
BSt KrSt
MSt KrSt
they are possible street intersections from ASt to MSt. I have to output the list of streets in order to reach MSt from ASt like:
ASt
BSt
KrSt
MSt
This is to be done using Breadth First Search.
The problem i am facing is that, i have stored the intersections in a string vector, but i am not able to compare two string vector elements.
Can anyone kindly help me out here. I already tried the == and compare function.
The problem is that i have to read in a text file which is something like:
ASt BSt
BSt WSt
BSt YeSt
BSt KrSt
MSt KrSt
they are possible street intersections from ASt to MSt. I have to output the list of streets in order to reach MSt from ASt like:
ASt
BSt
KrSt
MSt
This is to be done using Breadth First Search.
The problem i am facing is that, i have stored the intersections in a string vector, but i am not able to compare two string vector elements.
Can anyone kindly help me out here. I already tried the == and compare function.
![]() |
Similar Threads
- copying string from a vector to another (C++)
- Newbie string problem (C)
- Determine if a certain ivalue is in a string (C++)
- string problem (IMPORTANT) :(( (C)
- Problem of sorting words of each string using pointers (C++)
- Playing with shared memory - problem with non 'simple' data types (C++)
Other Threads in the C++ Forum
- Previous Thread: Need help making a program
- Next Thread: g++ and int main
| Thread Tools | Search this Thread |
api array based binary bitmap business c++ c/c++ char class classes code coding commentinghelp compile console conversion count decide delete deploy desktop developer directshow dll download dynamic dynamiccharacterarray email encryption error file forms fstream function functions game givemetehcodez graph guess gui homeworkhelp homeworkhelper iamthwee ifpug ifstream incrementoperators infinite input int integer java lib linkedlist linker loop looping loops map math matrix memory multiple news node number numbertoword output parameter pointer problem proficiency program programming project python random read recursion reference rpg string strings temperature template templates test text text-file tree url variable vector video win32 windows winsock word wordfrequency wxwidgets





