© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•3y ago•
7 replies
Ole (ping please)

❔ Sorting a list of objects into a tree structure

I have a set of objects that looks roughly like this:

class Item
{
public uint Id;
public uint ParentId;
}
class Item
{
public uint Id;
public uint ParentId;
}


To visualize the data I want to sort the data into a graph. Is there a built in way of doing this in C#?
For the actual visualisation I am happy with just viewing it in the debugger. The reason for asking the question instead of just doing it is that I want to get better at using built in functionality. I string.Join(", ", array) was a game changer for example
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

❔ Reading a Json-File into a List Of Objects
C#CC# / help
3y ago
✅ List of inherited objects
C#CC# / help
3y ago
Assigning variables to a list of objects
C#CC# / help
4y ago
❔ How to create a list of generic objects?
C#CC# / help
3y ago