; = firstArc-> nextArc; sideNode;
} (fileOutput) {. close ();
* out <
cout <<"Запис у файл успішно завершена!" <
} _STAGE = START_EXECUTION;;
}
} ("pause"); ();
} * assembleGraph (int & NUM_VERTEX, ostream * stream) {* firstNode = NULL, * lastNode = NULL, * currentNode; getArcData (string graphName, int & NUM_VERTEX, DirectedGraph * & lastNode , ostream * stream = & cout); graphName; <<"Ім'я графа:";
_input (graphName); (getArcData (graphName, NUM_VERTEX, firstNode, stream)) {= firstNode; (getArcData (graphName, NUM_VERTEX, lastNode)) {> previousArc = currentNode;> nextArc = NULL;> nextArc = lastNode; = lastNode;
}
} firstNode;
} getArcData (string graphName, int & NUM_VERTEX, DirectedGraph * & lastNode, ostream * stream = & cout) {fstream fileForReadGraph; filePath = "graphs /"; inVertexId; int counter = 0; sideChar; bool firstIn = true; fileExists (string fileName); openFile (string fileName, char mode); (firstIn) {(! fileExists (filePath + graphName + ". txt")) {
cout <<"Графа з таким ім'ям не існує!" <
} = openFile (filePath + graphName + ". txt", 'i');
* stream <<"Граф" <
} (fileForReadGraph.eof ()) {= true; _VERTEX = counter; = 0;. close (); false;
} = (DirectedGraph *) new (DirectedGraph);> previousArc = NULL;> nextArc = NULL; (lastNode == NULL) {
cout <<"Пам'ять виділилася!" < Sleep (1000); (1);
}>> inVertexId;> oneArc.inVertexId = inVertexId;> oneArc.outVertexId = counter; = fileForReadGraph.get (); (sideChar == ' n') + +; true;
} findVertexAndPrintNewList (DirectedGraph * firstNode, int NUM_VERTEX, int & maxLevelOfVertex, ostream * stream) {counter, inVertexCounter, vertexWithMaxLevel = 0; = 0; (counter = 1; counter <= NUM_VERTEX; counter + +) {= 0; ((firstNode! = NULL) && (firstNode-> oneArc.outVertexId == counter)) {+ +; = firstNode-> nextArc;
}
* stream <<"Ступінь результату вершини" < maxLevelOfVertex) {= inVertexCounter; = counter;
}
}
* stream <<"Вершина з максимальною ступенем результату:" <
} foundInArray (int value, int * arr, int rightBound) {counter, middle, leftBound = 0; ((value> arr [rightBound]) | | (val...