I have a simple weighted tree with a root, nodes and leafs. Now I want to assign a value to every path from the root to a leaf which will be the sum of all the weights.
Is there a way of creating a structure with 2 fields: the value and a vector (which will hold a path) i.e.: (10,[root,node1,node3,node5]) (the length of the path doesn't have to be the same every time!) which I then could store in a vector [path1 path2 path3 ...]?
@Edit: also, I do know there's struct() but I don't really like it, is there any other way to do it?