Closed. This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only...
I’m really confused about the differences between big O, big Omega, and big Theta notation. I understand that big O is the upper bound and big Omega is the...
I believe there’s a way to find the kth largest element in an unsorted array of length n in O(n). Or perhaps it’s “expected” O(n) or something. How can...
Are there are any cases where you would prefer O(log n) time complexity to O(1) time complexity? Or O(n) to O(log n)? Do you have any examples? 23 Answers...
I am to show that log(n!) = Θ(n·log(n)). A hint was given that I should show the upper bound with nn and show the lower bound with (n/2)(n/2). This...
If I have some R list mylist, you can append an item obj to it like so: mylist[[length(mylist)+1]] <- obj But surely there is some more compact way. When...
This question already has answers here: What is a plain English explanation of “Big O” notation? (43 answers) Closed 4 years ago. I’m asking more about what this means...
Are there any O(1/n) algorithms? Or anything else which is less than O(1)? 32 Answers 32 This question isn’t as silly as it might seem to some. At least...
I understand Big-O notation, but I don’t know how to calculate it for many functions. In particular, I’ve been trying to figure out the computational complexity of the naive...
After using PHP for a while now, I’ve noticed that not all built-in PHP functions are as fast as expected. Consider these two possible implementations of a function that...