Looking for some C++ Expert to answer this, make it well commented and do the documention aswell. Make it recursive functionality and doing it as a college students point of view, should be working and robust.