These two seem very similar and have almost an identical structure. What's the difference? What are the runtime complexities of each?