🗂️ analysis.c
#include "analysis.h"
#include <stdio.h>
void saveResult(int algorithm, int path, int expanded, double time) {
FILE *fp = fopen("result.txt", "a");
const char *name = (algorithm == 1) ? "DFS" :
(algorithm == 2) ? "BFS" : "A*";
fprintf(fp, "%s %d %d %.2f\n", name, path, expanded, time);
fclose(fp);
}