Recent questions tagged space-complexity

0 0 votes
1 1 answer
94
94 views
What is the space complexity of the CYK algorithm for the $\mathrm{P}$ table, where $\mathrm{n}$ is the number of words in the sentence and $\mathrm{m}$ is the number of ...
1 1 vote
0 0 answers
286
286 views
Space Complexity: Total memory used by an algorithm, including the input data, temporary storage, and output data.Auxiliary Space Complexity: Extra memory used during the...
0 0 votes
1 1 answer
612
612 views
0 0 votes
3 3 answers
2.1k
2.1k views
What is the time & space complexity of this algorithm?Main(){ for(i=n; i>10; i=i^1/4) { for(j=201; j<n^3; j=j+400) ...
0 0 votes
0 0 answers
780
780 views
int sum(int A[], int n) { int sum = 0, i; for(i = 0; i< n; i++) sum = sum + A[i]; return sum; } What is the space complexity? Select one: a. 2n + 8 b. 2n + 16 c. n^2 d. n...
0 0 votes
0 0 answers
420
420 views
Please list out the best free available video playlist for Asymptotic Worst-Case Time and Space Complexity from Algorithm as an answer here (only one playlist per answer)...
18 18 votes
2 answers 2 answers
1.8k
1.8k views
For the given recurrences calculate the tightest bound on time and space that would be required by a dynamic programming algorithm to compute $\text{OPT}(n).$$$\text{OPT}...
1 1 vote
1 1 answer
1.4k
1.4k views
Match $\text{List I}$ with $\text{List II}$$\begin{array}{llll} & \text{List I} & & \text{List II} \\ (A) & \text{Greedy Best-First Search} & (I) & \text{Space complexity...
1 1 vote
0 0 answers
2.9k
2.9k views
What is the time complexity for infinite loopsQuestion 1 what is T(n) for this caseWhile(1){a=a+b;} Question 2 for this caseif(1){for i to na=a+b}else{for i to nfor j to...
0 0 votes
1 1 answer
1.6k
1.6k views
Ans given is option-B
0 0 votes
0 0 answers
344
344 views
Stack space size of counting numbers of inversion??????
0 0 votes
1 1 answer
806
806 views
what is space complexity of an algo?and what is the number of function calls in general?
5 5 votes
2 answers 2 answers
2.0k
2.0k views
What is the space complexity of the following code?$O(logn)$ $O(n)$$O(nlogn)$ $O(1)$ void f(int n){if(n
2 2 votes
1 1 answer
4.0k
4.0k views
I read that the space complexity of Dijasktra is $O(V^2)$ . (http://igraph.wikidot.com/algorithm-space-time-complexity)But how ????
0 0 votes
0 0 answers
840
840 views
I'm kind of confused between these two terms as for example - the Auxiliary space of merge sort, heapsort and insertion sort is O(1) whereas Space complexity of merge sor...
0 0 votes
2 2 answers
5.4k
5.4k views
Since Heapify is a recursive function, its space complexity is $O(logn)$ because of the stack space required for recursion.I also read that space complexity of heapsort i...
0 0 votes
3 answers 3 answers
1.1k
1.1k views
int main() { int i; for(i=1;i<=n;i++) f(i); } void f(int n) { int A[n]; int j; for(j=1;j<=n;j++) cout<<j; }What will be the time and space complexity of the following cod...
1 1 vote
1 1 answer
3.6k
3.6k views
What is time and space complexity to evaluate postfix expression ?
1 1 vote
2 answers 2 answers
5.6k
5.6k views
what is Space complexity of Huffman coding?
1 1 vote
3 3 answers
3.5k
3.5k views
First read it properly. I am not asking a specific question about space complexity.Question: What is worst case space complexity of quick sort?Everywhere it is showing O(...
0 0 votes
1 answers 1 answer
590
590 views
is it true that space complexity is always less than equal to time complexity i.e. S(n) = O(T(n)) I think it is.
1 1 vote
0 0 answers
490
490 views
Sartaj Sahani Chapter 7 question 9I seem to have stumbled upon something very basic, and I can't figure out why.The question asks "How large can the ratio of two memory r...
3 3 votes
1 1 answer
1.8k
1.8k views
I am having a doubt in this question. The binary search algorithm is implemented using recursion. Then the space complexity is :-(1) O( 1 )(2) O( n )(3) O( logn )(4) O(n ...
1 1 vote
1 1 answer
2.9k
2.9k views
The binary search algorithm is implemented using recursion. Then the space complexity is$\mathrm{O}(1)$$\mathrm{O}(\mathrm{n})$$\mathrm{O}(\log \mathrm{n})$$O(n \log n)$
3 3 votes
1 answers 1 answer
1.0k
1.0k views
Merge sort using linked list is better than array in terms of space complexitytrue or not with explanation :)
3 3 votes
2 answers 2 answers
1.1k
1.1k views
Worst case and best case space complexity of merge sort is ___________________________