INT NET [] = {1, 2, 2, 1, 3, 3, 4, 4}; Bool Checkbox (int Net [], int N) {stack * s = new stack (n) For (int i = 0; i == Net [IF ((Net [i] == Net [S-> TOP ()]) {INT X; -> delete (x);} else s-> add (i);} else s-> add (i);} // Is there a non-wiring network group IF (S-> iSempty ()) {delete S; COUT << "Switch Box Is Routable" << Endl; Return True;} delete S; cout << "switch box is not routable << endl; return false;}
Ref: << Data Structure, Algorithm & Applications >> P176 ~ 178