Witam. Pisze w Turbo Delphi program który ma wyszukać cykl eulera w grafie. Mam problem z algorytmem spójności grafu. Czy istnieje możliwość żeby ktoś mi wytkną błędy w tym kodzie i powiedział co robię źle i jak mam to poprawić??
Załączam niżej kod.
procedure TForm1.Button2Click(Sender: TObject);
var
I, J, id: Integer;
mac_sas: array of array of integer;
visited:array of integer;
C:array of integer;
procedure component(var I: integer);
var
J: integer;
begin
visited[I]:=1;
C[I]:=id;
for J := 1 to n do
if visited[J] = 0 then
component(J);
end;
begin
SetLength(mac_sas, n, n);
SetLength(visited, n);
SetLength(C, n);
with Macierz do
for I := 1 to ColCount do
For J := 1 To RowCount do
mac_sas[I, J]:=StrToInt(Cells[I, J]);
for I := 0 to n do
visited[I]:=0;
id:= 0;
for I :=1 to n do
if visited[I] = 0 then
id:= id + 1;
component(I);
end;