I have an array where the indexes "parents" are not indexed with underlines and the children are. Every time a parent receives a child, all other parents also receive a child.
Example we have 2 children:
array(
x = array()
x_1 = array()
x_2 = array()
y = array()
y_1 = array()
y_2 = array()
);
I need to get all indexes that are parents, in this case x and y. The solution I found would be to traverse the vector looking for indexes that have no underline, but I did not find a pretty solution, as I would have to go through the vector again to add new children.
Would anyone have a simpler and / or more beautiful solution?