Monday, July 26, 2021

What is time complexity of following code

        int count = 0;
        for (int i = N; i > 0; i /= 2) {
            for (int j = 0; j < i; j++) {
                count += 1;
            }
        }

Comments URL: https://news.ycombinator.com/item?id=27964120

Points: 1

# Comments: 0



from Hacker News: Newest https://ift.tt/2WcyK8b
via IFTTT

No comments:

Post a Comment

The Untold Story of How One Guy Keeps the World Running on the Right Timezone

Article URL: https://onezero.medium.com/the-largely-untold-story-of-how-one-guy-in-california-keeps-the-worlds-computers-on-the-right-time-a...