bits[i] = true; genBitStrings(bits, i+1); bits[i] = false; genBitStrings(bits, i+1);
node* head = myVertices[i] -> link(); while(head != NULL){ // get the name of the current neighbor and then its index string nbrName = head -> data(); int j = getIndex(nbrName); // Search for the current vertex in neighbor's list node * nbrHead = & myVertices[j]; while((nbrHead->link())->data() != name) nbrHead = nbrHead -> link(); // Delete the current vertex from neighbor's list list_remove(nbrHead); // Go to the next neighbor head = head -> link(); }
graph::~graph(){ for(int i = 0; i < myNumberVertices; i++) list_clear(myVertices[i]->link()); }
VERTEX PARENT B A C D D A E D F D G C H G
4*256 + 4*128 + 4*64 + 4*32 + 4*16 + 4*8 + 4*4 + 4*2 = 4*510 = 2040