title: Java Organisational Chart Data Structure
body: <p>I am writing a project to create organisational charts from Active Directory where if you give the program a list of names (employees) the root node is the lowest common manager for those employees. This could be the real top manager of the organization, or a department manager, it varies depending on the names. </p>
  
  <p>I can use active directory manager attributes to retrieve manager names, and currently I run through each employee getting their manager until the top is reached creating an ArrayList... then I need a way to compare the lists to identify the common manager. I did this using List.contains() for just two people, but this isn't scalable to more than 2 people. Any suggestions here? </p>
  
  <p>I wish to create a tree data structure with the common manager as the root node, which contains all the people in the lists below the common manager, and their parent-child relationships. </p>
  
  <p>Which data structure would be suitable for this? </p>