I would like to know how to create a structure to hold three lists in the following format:
[[[x],[y]],[z]]
with x,y,z being three lists of strings.
Note that I want to have the x and y lists on the 3rd level down and the z list on the 2nd level down.
I have tried creating 3 separate arraylists for x,y and z then another arraylist that holds x and y. The problem arise when I tried to create the outer most arraylist to hold all three, because something like
ArrayList<ArrayList<ArrayList<String>>> outerList = new ArrayList<ArrayList<ArrayList<String>>>();
would work for x and y but wont work for z because z is only 2 levels down.
I understand what I'm trying to do is more like a tree but I do not know how to implement a non-binary tree in java (x,y,z having more then just 2 branches).
What I'm trying to get out of this is a way to assign weights eg. user inputs a term, I iterate first through all the child nodes (x,y,z) and try to find it. If I find it I assign a high weight, otherwise I try to find it in the parent nodes (the list that holds x,y) and give it a moderate weight else I search in the root node and assign a minimum weight. The structure described is simply the relationship between the terms that I have categorized.
Any ideas on how to do this?