Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void delNodo(const T nodo) {
- #ifdef NDEBUG
- std::cout << ">DelNodo(nodo)" << std::endl;
- #endif
- int target = exist(nodo);
- if (target >= 0) {
- Grafo<T,Eql> tmp(_size - 1);
- for(int i = 0,x = 0; i < NumNodi();i++)
- if (i != target) {
- tmp.nodi[x]=nodi[i];
- for (int j = 0, y = 0; NumNodi() < 3; j++) {
- if (j!=target){
- tmp.archi[x][y] = archi[i][j];
- y++;
- }
- }
- x++;
- }
- swap(tmp);
- }
- else
- std::cout << "Nodo non presente" << std::endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement