Taxidriver
Programmer
Hello,
I have a binary search tree whose nodes should be of 3 different types: one node should store information for a point, the second for a segment (2 points) and the third for an area (2 points, 2 segments and other information). I use a struct that can be used for all 3 (there's a flag that identifies what the node contains) but I think that I waste a lot of space. Is there a way to save space? Could the "union" be of some use or, in my situation, is of not much convenience?
Thanks.
I have a binary search tree whose nodes should be of 3 different types: one node should store information for a point, the second for a segment (2 points) and the third for an area (2 points, 2 segments and other information). I use a struct that can be used for all 3 (there's a flag that identifies what the node contains) but I think that I waste a lot of space. Is there a way to save space? Could the "union" be of some use or, in my situation, is of not much convenience?
Thanks.