Hello everybody, i'm new at prolog and to improve my skills i'm trying to make some exercise.
At the moment I'm stuck with a BFS, let assume the tree is something like this:
a
/\
b c
/\
d e
after my query i've something like
X=a;
X=b;
X=c;
X=d;
X=e;
or, at least:
X=a,b,c,d,e;
I'm wondering about how to have results ordered by depth levels as output, something like:
X=[a];
X=[b,c];
X=[d,e];
HEEEEELP
At the moment I'm stuck with a BFS, let assume the tree is something like this:
a
/\
b c
/\
d e
after my query i've something like
X=a;
X=b;
X=c;
X=d;
X=e;
or, at least:
X=a,b,c,d,e;
I'm wondering about how to have results ordered by depth levels as output, something like:
X=[a];
X=[b,c];
X=[d,e];
HEEEEELP