A study on segment and interval trees