General Tree in Java
807603Feb 9 2008 — edited Feb 9 2008Hi,
I know this question has been asked several times in the forum. I read all of them but i still have problems with implementing a general tree in Java. I can't use binary tree, because i don't know how to use binary tree instead of general tree to solve this question. Binary tree or red-black tree doesn't work for me. My data structure looks like this
Vehicle
Mission1 Mission2 Mission3................................Mission10
M2 M3......M10 M1 M3......M10 M1 M2...... M10 M1 M2..........M9
M3..M10 M2 M4...... M3 M4 ...........
and goes like this. What i mean by this is, there is a vehicle which can be assigned more than one mission(e.g. it can be assigned M1, M3, M6, M10 or M2, M6, M10). I want to solve this assignment problem by tree structure in Java but the problem is I still couldn't understand how to implement it. Should i try to do somthing with TreeSet or JTree or DefaultTreeModel and TreeNode or should I try to write my own code (I am really scared to do that). Any help appreciated
Thank you