For the list, it can be classified by create set+member index , but how can the same operation be implemented in tree data? the list idem does’t work anymore, wrong assignment.
Well … given the opportunity … the answer to that - for the general case: any collection, any imaginable search/query - is that you need code.
See attached where a test rnd Box collection (a Tree) is created (1st C#) and then 2 primitive searches are performed (2nd C#). If you are interested on the subject (or you have plans to walk the right walk) I could explain a bit how things like these are handled properly.