0

Is there any official tree data structure in C#? I need it for ASP.NET Core. I need to build, level by level, a file system tree. And then search for elements and so on.

Thank you

Cadmi
  • 53
  • 1
  • 7
  • 1
    Does this answer your question? [Tree data structure in C#](https://stackoverflow.com/questions/66893/tree-data-structure-in-c-sharp) – Ackdari Apr 02 '20 at 10:02
  • Why do you need to build a tree of the file system before you walk it? – Sean Apr 02 '20 at 10:04
  • Here's my favourite implementation of a tree: `public class Tree : List> { public T Value { get; private set; } }`. – Enigmativity Apr 02 '20 at 10:05
  • It's quite trivial to add a visitor pattern to that to do searches. – Enigmativity Apr 02 '20 at 10:07
  • thanks for your answers. The reason why I need to buiñld the tree before walking it, is because I retrieve it from a Web Service. This WS can't give me at once the whole tree, so I need to request for it directory per directory. I will implement it on my own :) – Cadmi Apr 02 '20 at 10:39

0 Answers0