// problem2.cpp : Defines the entry point for the console application. // #include #include #include using namespace std; #include "apvector.h" #include "graph.h" bool different_by_one(string str1, string str2) { int numDifferent=0; if(str1.length()!=str2.length()) return false; for(int count=0;count1) return false; } if(numDifferent==0) return false; return true; } int main() { const int MAX_NEIGHBORS=30; ifstream in("words.dat",ios::in); graph myGraph; string word; apvector numNeighbors(MAX_NEIGHBORS,0); apvector words(10000); int numWords=0; while(in>>word) { myGraph.addVertex(word); words[numWords]=word; numWords++; for(int count=0;count