leaf([X,[], []], [X]). how to get the list of leaves of a tree?

前端 未结 0 1681
梦谈多话
梦谈多话 2021-02-20 16:25

I wrote this code for get the leaves of a tree.

leaf([X,[], []], [X]).
leaf([_, G, D], N):-leaf(G, N1), leaf(D, N2), mix(N1, N2, N3), N is N3.

bu

相关标签:
回答
  • 消灭零回复
提交回复
热议问题