Storing strings within a tree in a memory efficient manner