This can be easily represented as a loop that traverses the input sentence from left to right, linking each word to another from the same sentence or to the dummy root.
we just need n steps to process the n words of a given sentence and build a dependency tree.