Embed presentation
Download to read offline

The first code snippet has a time complexity of O(log n) due to the loop doubling 'i' with each iteration. The second snippet has a time complexity of O(n log n) because the outer loop runs 'n' times while the inner loop also runs logarithmically with respect to 'j'. Both snippets output values to the console based on their respective loops.
