Use tree for representing the ds