我使用這樣的結構,開發一個叉樹在C: typedef struct sNaryNode {
int *data; // Point to the node ’s data
int n; // The number of children
struct sNaryNode **child; // The child list
} NaryNode;
typedef
在C#中,如何獲得所有子對象的最佳方式,其中的子對象可以有子對象? 下面是一個例子: 我有一個叫Test類,它有以下ID: int id
int parentId
我有一個List<Test>稱爲testItems被填充了許多測試對象。 每個Test對象,具有id,並且可以具有在ListTest另一個對象的parentId。 如果我有一個id,獲得所有孩子(包括孩子的孩子)的IEnumer