calculate time complexity of two functions

What is the difference between time complexity of O(n) and O(Log n). Let us say I have a function which has time complexity of O(Log n) and space complexity of n. What will be the time complexity if I have to calculate addition two functions with time complexity of Log n and Log n Log… Read More calculate time complexity of two functions

Time complexity for middlepoint circle algorithm

https://en.wikipedia.org/wiki/Midpoint_circle_algorithm https://www.geeksforgeeks.org/mid-point-circle-drawing-algorithm/ I have been looking into the midpoint circle algorithm and have come across conflicting information on its time complexity. On the Wikipedia page, complexity is not mentioned, but in the GeeksforGeeks article, it is listed as O(x – y). In the above geeksforgeeks article it mentioned Time Complexity: O(x – y) Auxiliary Space:… Read More Time complexity for middlepoint circle algorithm

What is the time complexity of this python function which includes slice operations?

I am learning python slice operations and I decided to write a simple function that iterates through a string with a window of size k and adds the window to the dictionary along with its frequency. So for example if the string input is "abab" and k is 2, the dictionary will contain "ab:2" and… Read More What is the time complexity of this python function which includes slice operations?