How to extract a group of DataTree Branches in C#?

I can understand most task means. But I still not quite understand Matrix. Really not good at Math… Will learn more! Thanks.