Login
Register
Dark Mode
Brightness
Profile
Edit Profile
Messages
My favorites
My Updates
Logout
Recent questions tagged space-complexity
0
votes
1
answer
1
#AppliedGate
Dknights
152
views
Dknights
asked
Jan 2
Algorithms
space-complexity
algorithms
+
–
0
votes
3
answers
2
Self doubt.
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) { for(k=47; k<=n^84; k=k*108) { k=k^61; } } } }
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) ...
Nisha Bharti
680
views
Nisha Bharti
asked
Sep 26, 2022
Algorithms
algorithms
time-complexity
space-complexity
self-doubt
+
–
0
votes
0
answers
3
Capgemini Mock Test 2023
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 + 8 What is the space complexity?
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...
chokostar
474
views
chokostar
asked
Aug 24, 2022
Programming in C
space-complexity
+
–
0
votes
0
answers
4
Best Open Video Playlist for Asymptotic Worst-Case Time and Space Complexity Topic | Algorithm
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). We'll then select the best ... are more likely to be selected as best. For the full list of selected videos please see here
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)...
makhdoom ghaya
197
views
makhdoom ghaya
asked
Aug 17, 2022
Study Resources
go-classroom
video-links
missing-videos
free-videos
asymptotic-notation
time-complexity
space-complexity
+
–
1
votes
1
answer
5
UGC NET CSE | October 2020 | Part 2 | Question: 73
Match $\text{List I}$ with $\text{List II}$ ... $\text{A-III, B-II, C-IV, D-I}$ $\text{A-III, B-IV, C-II, D-I}$
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...
go_editor
861
views
go_editor
asked
Nov 20, 2020
Algorithms
ugcnetcse-oct2020-paper2
space-complexity
algorithms
+
–
1
votes
0
answers
6
Time Complexity for an infinite loop
What is the time complexity for infinite loops Question 1 what is T(n) for this case While(1) { a=a+b; } Question 2 for this case if(1) { for i to n a=a+b } else { for i to n for j to n a=a+b } Edit 2: Compiled the code ... ); return 0; } output I get is 8 6 which means the else case is never executed hence in worst case do we have to consider the else part.
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...
sripo
1.9k
views
sripo
asked
Nov 6, 2018
Algorithms
algorithms
time-complexity
asymptotic-notation
space-complexity
+
–
0
votes
1
answer
7
ACE algo test series
Ans given is option-B
Ans given is option-B
Daniyal89
695
views
Daniyal89
asked
Sep 30, 2018
Algorithms
sorting
space-complexity
algorithms
ace-test-series
+
–
0
votes
0
answers
8
Space complexity
Stack space size of counting numbers of inversion??????
Stack space size of counting numbers of inversion??????
Deepalitrapti
164
views
Deepalitrapti
asked
Sep 2, 2018
Algorithms
space-complexity
+
–
0
votes
1
answer
9
Algorithms
what is space complexity of an algo? and what is the number of function calls in general?
what is space complexity of an algo?and what is the number of function calls in general?
shipra tressa
383
views
shipra tressa
asked
Aug 31, 2018
Algorithms
space-complexity
descriptive
+
–
5
votes
2
answers
10
Test Algorithms
What is the space complexity of the following code? $O(logn)$ $O(n)$ $O(nlogn)$ $O(1)$
What is the space complexity of the following code?$O(logn)$ $O(n)$$O(nlogn)$ $O(1)$
Shivani gaikawad
1.0k
views
Shivani gaikawad
asked
Aug 17, 2018
Algorithms
algorithms
space-complexity
test-series
+
–
2
votes
1
answer
11
Space Complexity of Dijkastra's algorithm
I read that the space complexity of Dijasktra is $O(V^2)$ . (http://igraph.wikidot.com/algorithm-space-time-complexity) But how ????
I read that the space complexity of Dijasktra is $O(V^2)$ . (http://igraph.wikidot.com/algorithm-space-time-complexity)But how ????
Hardik Maheshwari
3.0k
views
Hardik Maheshwari
asked
Jul 5, 2018
Algorithms
dijkstras-algorithm
shortest-path
space-complexity
algorithms
graph-algorithm
greedy-algorithm
+
–
0
votes
0
answers
12
#Algorithms Space Complexity Vs Auxiliary Space Complexity?
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 sort, insertion sort, heapsort is O(n). So, if ... ? Furthermore I know - Space Complexity = Auxiliary Space + space taken by also wrt input. Kindly help, thank you!
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...
iarnav
589
views
iarnav
asked
Jun 26, 2018
Algorithms
algorithms
space-complexity
+
–
0
votes
1
answer
13
Space Complexity of Build Max Heap
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 is $O(1)$ beause of the explanation here - https://gateoverflow.in/79909/ ... complexity of build heap is $O(logn)$ then heapsorts complexity should also be the same . What am I missing here ?
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...
Hardik Maheshwari
4.7k
views
Hardik Maheshwari
asked
Jun 14, 2018
Algorithms
space-complexity
algorithms
binary-heap
heap-sort
+
–
0
votes
3
answers
14
Self-Doubt
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 code snippet ?
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...
Phlegmatic
494
views
Phlegmatic
asked
Jun 8, 2018
Algorithms
algorithms
time-complexity
space-complexity
+
–
1
votes
1
answer
15
Evaluation of Postfix expression using stack
What is time and space complexity to evaluate postfix expression ?
What is time and space complexity to evaluate postfix expression ?
JaiKumar Guwalani
2.7k
views
JaiKumar Guwalani
asked
May 6, 2018
DS
data-structures
time-complexity
space-complexity
infix-prefix
stack
+
–
1
votes
2
answers
16
Space complexity of Huffman coding
what is Space complexity of Huffman coding?
what is Space complexity of Huffman coding?
Akash Kumar Roy
3.9k
views
Akash Kumar Roy
asked
Apr 26, 2018
Algorithms
huffman-code
algorithms
space-complexity
+
–
1
votes
3
answers
17
MY DOUBT: Worst case space complexity of Quick sort (NOT FOR A STRAIGHT ANSWER)
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(logn). My understanding about it: I know that Quick ... by ratio 1:n-1 which is worst case, wouldn't it be requesting for O(n) stack records?
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(...
Akash Kumar Roy
2.4k
views
Akash Kumar Roy
asked
Apr 21, 2018
DS
algorithms
sorting
data-structures
space-complexity
+
–
0
votes
1
answer
18
test series
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.
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.
mehul vaidya
285
views
mehul vaidya
asked
Mar 31, 2018
Algorithms
test-series
space-complexity
time-complexity
+
–
1
votes
0
answers
19
How large can the ratio of two memory requirements get?
Sartaj Sahani Chapter 7 question 9 I 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 requirements get?" when a 2D Array is stored as a 2d array in c++ ... ) / (4mn) = 1 + 4/n. Shouldn't it be 1 +1/n ? Can anyone help me out here ? Thanks.
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...
XbrucewayneX
310
views
XbrucewayneX
asked
Mar 3, 2018
DS
data-structures
array
space-complexity
+
–
3
votes
1
answer
20
Algorithms
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 logn ) According to me, the answer should be option 2. Please explain the solution as well.
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 ...
Asim Abbas
970
views
Asim Abbas
asked
Jan 12, 2018
Programming in C
algorithms
space-complexity
+
–
1
votes
1
answer
21
binary search space complexity
Aditya Bahuguna
2.4k
views
Aditya Bahuguna
asked
Jan 7, 2018
Algorithms
binary-search
recursion
space-complexity
test-series
+
–
3
votes
1
answer
22
merge sort
Merge sort using linked list is better than array in terms of space complexity true or not with explanation :)
Merge sort using linked list is better than array in terms of space complexitytrue or not with explanation :)
A_i_$_h
741
views
A_i_$_h
asked
Nov 14, 2017
Algorithms
algorithms
merge-sort
space-complexity
+
–
3
votes
2
answers
23
Space complexity
Worst case and best case space complexity of merge sort is ___________________________
Worst case and best case space complexity of merge sort is ___________________________
srestha
603
views
srestha
asked
Nov 11, 2017
Algorithms
algorithms
space-complexity
+
–
2
votes
1
answer
24
How to determine the time complexity of this loop?
// func() is any constant root function for (int i = n; i > 0; i = func(i)) { // some O(1) expressions or statements } "In this case, i takes values n, n1/k, (n1/k)1/k = n1/k2, ... do we calculate that there are logk(log(n)) iterations? Source: http://www.geeksforgeeks.org/time-complexity-loop-loop-variable-expands-shrinks-exponentially/
// func() is any constant root functionfor (int i = n; i 0; i = func(i)){ // some O(1) expressions or statements}"In this case, i takes values n, n1/k, (n1/k)1/k = n1/...
Narasimhan
999
views
Narasimhan
asked
Nov 7, 2017
Algorithms
algorithms
asymptotic-notation
time-complexity
space-complexity
non-gate
+
–
5
votes
1
answer
25
In-place Merge Sort via Doubly linked list in place of Array
In general merge sort is not considered in-place sorting technique. Because an auxiliary array is used. If we will try to do it in-place in array data structure then our merge procedure will take O($n^2$) time. so overall ... list in place of Array (for storing and merging data) ? Please share your valuable opinion. It will be great help.
In general merge sort is not considered in-place sorting technique. Because an auxiliary array is used. If we will try to do it in-place in array data structure then our ...
Chhotu
1.3k
views
Chhotu
asked
Nov 2, 2017
Algorithms
algorithms
sorting
space-complexity
linked-list
time-complexity
+
–
Page:
1
2
next »
Email or Username
Show
Hide
Password
I forgot my password
Remember
Log in
Register