I'm having trouble converting code fragments into equations that figure out T(n) of said equation. An example code fragment is this: a = b + c; d = a ...
I'm having trouble converting code fragments into equations that figure out T(n) of said equation. An example code fragment is this: a = b + c; d = a ...
So I was trying to find big O of this function. The outer loop is O(N^2) alone, and the inner loop goes from 0 to N^2. So I was thinking this would ...
I am a little bit confused, I tried to understand which arrays would be the worst case scenario for quicksort (chatgpt contradicted itself several an ...
Can you give the asymptotic analysis of this I have tried analysing but I was stuck at the inner loop ...
How do you calculate the cost function for this loop: Along with the cost function, what is the Big-O notation? ...
Rank the functions in increasing order of growth: F1(n) = n^(n/2) F2(n) = (n/2)^n F3(n) = (log n)^(log n) F4(n) = 8^(log n) F5(n) = n^(4/3) F6(n) ...
can someone tell me what type of o notation this algorithm is, i think its O(n^2) but i want to make sure im getting this right ...
I think the answer to this question is o(1) since the loop only iterates from 0 to 9 but when discussing this same question with my friend he told me ...
I am studying Priority Queues using Data Structures and Algorithms in C++, 2nd Ed. (Goodrich, Tamassia, Mount) and I'm reading the page on insertion s ...
double expRecursive(double x, int n) { if (n <= 4) { return expIterativ(x, n); } return expRecursive(x, n/2) * expR ...
I wrote a program that solves maze that is not ideal (has 1 or more correct paths) using recursion DFS algorithm. I have a problem with the time compl ...
So I'm following a algorithms course and it asked to implement the following function: Write a function called findLongestSubstring, which accepts ...
What will be the time complexity for this function, can someone explain? I am trying to find the time complexity for the given function. I think th ...
Is it really any different from O(2^n)?? It's like saying n where n is in the set of i/2 where i is any real number. If i is a set of real numbers, t ...
I'm trying to figure the time complexity of this function out: Pseudo-code Is the time complexity O(n^2logN)? as you can see, this example is of a ...
What is the time complexity of this code? Is the innermost loop O(1) or O(n^2)? ...
I am trying to understand the complexity of an algorithm I am experimenting with. The site where I found the algorithm states that it has a complexity ...
Could anyone explain me the time complexity of this method? I'm not really good in this subject and tried to find out some info online but could't ...
I'm struggling to understand the concepts of calculating time complexity. I have this code in C, why does the time complexity is O(n) and not O(n log ...
I have a linear search algorithm with 2n + 2 comparisons in the worst case. How do I prove mathematically that the number of comparisons in the worst ...