No worries, it took me a while too. I was coming from other programming, but never got good enough to use any particularly complex data structures.
Maybe i’m repeating things you already understand, but here’s how I think of and teach it…
A Tree has Branches, each of which are identified by their Path.
Data is on that branch at some index.
To understand what a Path is, you might think of a suburb. The branching streets of a neighborhood form a tree structure and the houses all have addresses –paths. Some addresses are empty lots, and other ones have houses on them. Once you define the streets, its easy to add and remove houses without having to renumber the existing ones. The path is “where the data lives”, which in grasshopper can be changed around or renumbered with very little extra computation or slowness. That’s what tools like graft, simplify, trim tree, and shift path do.
So, the syntax {1,3,5,6} reads left to right as something like
The first highway exit, third avenue, fifth cul-de-sac, sixth house"
The format {A;B;C;D} in path mapper is a succinct way to describe the path structure
highway A; avenue B; cul-desac C; house D
I’ll use the same notation when commenting my scripts,
row A; col B; brep C; face D
or I’ll write it simply
row; col; brep; face
That way, I can remember which part of the path is numbering what. In the pathmapper, you also use a standard i index notation to refer to an item. To extend the analogy, it might be “…house D, floor i”.
{A;B;C;D}(i)
{highway; avenue; cul-desac; house}(floor)
{row; col; brep; face}(control point)
The path mapper lets you do arbitrary changes of the structure by using that abcd(i) format.
Maybe its not relevant to learning, but I find this page helps, where David Rutten explains why he chose to use trees over the more common data structure of lists of lists: