Login
Register
Dark Mode
Brightness
Profile
Edit Profile
Messages
My favorites
My Updates
Logout
Webpage for Algorithms
Recent questions tagged algorithms
0
votes
1
answer
121
tcp congestion control
Consider the effect of using Additive Increase Multiplicative Decrease (AIMD) algorithm with one way delay of 10ms. Assume the maximum segment size is 2 KB and the receiver window is 28 KB. The initial sender size threshold is set to 30 KB. For the ... a time out occurs. What will be the time required to completely send the first full window after timeout? (in msec)
Consider the effect of using Additive Increase Multiplicative Decrease (AIMD) algorithm with one way delay of 10ms. Assume the maximum segment size is 2 KB and the receiv...
24aaaa23
162
views
24aaaa23
asked
Oct 1, 2023
Algorithms
algorithms
tcp
+
–
0
votes
1
answer
122
function call
int foo(int n){ if(n<3) return 1; else return (foo(n-1) + foo(n-3) + 1); } Let ‘m’ denote the number of invocations of function foo and ‘n’ denote the return value when the function is called as foo(foo(5)). What is the value of m - n ?
int foo(int n){if(n<3)return 1;else return (foo(n-1) + foo(n-3) + 1);}Let ‘m’ denote the number of invocations of function foo and ‘n’ denote the return val...
24aaaa23
270
views
24aaaa23
asked
Oct 1, 2023
Algorithms
algorithms
identify-function
normal
+
–
0
votes
1
answer
123
algorithms
Let G1 (V, E) be a connected undirected graph and G2 (V1, E') be the subgraph of G1. Weights are assigned to the edges of G1. W(e) = 0; if e belongs to E' = 1 , otherwise. Single source shortest path algorithms is applied on G1 ... all pair of vertices and stored in a matrix. What will be additional time complexity (strict upper bound) to determine if G2 is connected or not.
Let G1 (V, E) be a connected undirected graph and G2 (V1, E') be the subgraph of G1. Weights are assigned to the edges of G1.W(e) = 0; if e belongs to E' = 1 , o...
24aaaa23
265
views
24aaaa23
asked
Oct 1, 2023
Algorithms
algorithms
shortest-path
time-complexity
+
–
1
votes
1
answer
124
consider the following message BCCABBDDAECCBBAEDDCC find the no of bits requiered for huffman encoding of above message
consider the following message BCCABBDDAECCBBAEDDCC find the no of bits requiered for huffman encoding of above message
amrit22
679
views
amrit22
asked
Sep 24, 2023
Algorithms
algorithms
greedy-algorithm
huffman-code
+
–
0
votes
1
answer
125
Recurrence relations
Consider the following function: function X(n,r) { if(r==0 or n == r) then return 1; else return (X(n-1,r-1,) + X(n-1,r)); } Find the worst case time complexity of function X ?
Consider the following function:function X(n,r) { if(r==0 or n == r) then return 1; else return (X(n-1,r-1,) + X(n-1,r)); }Find the worst case time complexity of function...
practicalmetal
382
views
practicalmetal
asked
Sep 15, 2023
Algorithms
recurrence-relation
algorithms
+
–
1
votes
1
answer
126
Self doubt
#include <stdio.h> void SSort(int [], int); void swap(int *,int*); int main() { int arr[] = {5,4,3,2,1,0}; int n = sizeof(arr)/sizeof(arr[0]); SSort(arr,n); for(int i = 0; i < n; i++) { printf("%d\t", arr[i]); } return 0; } void SSort( ... = *x; *x = *y; *y = tmp; } This is a selection sort algorithm. But the output of the algo is: 0 0 0 0 0 0. Where is the problem ?
#include <stdio.h>void SSort(int [], int);void swap(int *,int*);int main() { int arr[] = {5,4,3,2,1,0}; int n = sizeof(arr)/sizeof(arr[0]); SSort(arr,n); for(...
Gopal6854
336
views
Gopal6854
asked
Sep 13, 2023
DS
sorting
self-doubt
algorithms
+
–
0
votes
1
answer
127
Quick sort
13, 60,19,52,45,27,41,30,34,32.. Is this sequence in an array a worst case for Quicksort if first element is choosen as pivot always? I have tried to run algorithm of Quicksort on this sequence but not getting it.. Can anyone please explain this? My ... hence for whole array it would not be a worst of if sorting using Quicksort.. Can someone please tell me where I am thinking wrong??
13, 60,19,52,45,27,41,30,34,32.. Is this sequence in an array a worst case for Quicksort if first element is choosen as pivot always?I have tried to run algorithm of Quic...
Kanha3112
399
views
Kanha3112
asked
Sep 12, 2023
Algorithms
algorithms
quick-sort
+
–
0
votes
1
answer
128
number of min MSTs
Piyush1way
194
views
Piyush1way
asked
Sep 10, 2023
Algorithms
algorithms
+
–
1
votes
1
answer
129
test series
int i,j,k,s=0; for(i=1; i<=n; i++) { for(j=1 ; j<=i; j=j*2) { for(k=n; k>1;k=k/2) { s++; } } } What will be the time complexity of the above code?
int i,j,k,s=0; for(i=1; i<=n; i++) { for(j=1 ; j<=i; j=j*2) { for(k=n; k>1;k=k/2) { s++; } } }What will be the time complexity of the above code?
viral8702
452
views
viral8702
asked
Sep 1, 2023
Algorithms
zeal
algorithms
time-complexity
asymptotic-notation
+
–
0
votes
0
answers
130
Algorithm
Çșȇ ʛấẗẻ
92
views
Çșȇ ʛấẗẻ
asked
Aug 28, 2023
Mathematical Logic
algorithms
+
–
0
votes
0
answers
131
Algorithm
Çșȇ ʛấẗẻ
85
views
Çșȇ ʛấẗẻ
asked
Aug 28, 2023
Mathematical Logic
algorithms
+
–
0
votes
0
answers
132
Algorithm
Çșȇ ʛấẗẻ
70
views
Çșȇ ʛấẗẻ
asked
Aug 28, 2023
Mathematical Logic
algorithms
+
–
0
votes
0
answers
133
Made Easy Workbook
Huzaifa0111
168
views
Huzaifa0111
asked
Aug 27, 2023
Algorithms
divide-and-conquer
algorithms
made-easy-booklet
+
–
0
votes
1
answer
134
We are given a directed graph, represented as an adjacency list, in which each vertex has at least one incoming edge and one outgoing edge. We would like to print out for each vertex j the list of vertices pointing into j. What is the most accurate description of the complexity of computing these quantities in terms of n, the number of vertices, and m, the number of edges? O(n2) O(nm) O(m) O(n)
sonalrawat
689
views
sonalrawat
asked
Aug 21, 2023
Algorithms
algorithms
time-complexity
+
–
0
votes
1
answer
135
unacademy
int fun1( int n ) { int i , j , p =0, q =0; for( i =1 ; i < n ; ++i) { for( j =n ; j > 1; j = j/2) ++p; for( k =n ; k > p; k = k*2) ++q; } return q; }
int fun1( int n ){ int i , j , p =0, q =0; for( i =1 ; i < n ; ++i) { for( j =n ; j 1; j = j/2) ++p; for( k =n ; k p; k ...
yogeshsingh
403
views
yogeshsingh
asked
Aug 15, 2023
Algorithms
algorithms
+
–
0
votes
1
answer
136
Algorithm
Answer ????
Answer ????
Overflow04
252
views
Overflow04
asked
Aug 13, 2023
Algorithms
algorithms
time-complexity
+
–
0
votes
0
answers
137
Made Easy Test Series 2024
Suppose we have a directed graph G = (V,E) with V= {1, 2, ..., n} and Eis presented as an adjacency list. For each vertex u in V, out(u) is a list such that (u, v) in {1, 2, ... k). For each u in V, we wish to compute a corresponding list in(u) =such that in E ... take to construct the lists in(u), u in V, from the lists out(u), u in V? T(n) =O(n+m) B. T(n)= O(n(m+n))
Suppose we have a directed graph G = (V,E) with V= {1, 2, ..., n} and Eis presented as an adjacency list. For each vertex u in V, out(u) is a list such that (u, v) in {1,...
Ray Tomlinson
531
views
Ray Tomlinson
asked
Aug 9, 2023
Algorithms
made-easy-test-series
algorithms
made-easy-booklet
algorithm-design
time-complexity
linked-list
graph-theory
graph-algorithms
+
–
0
votes
0
answers
138
Made easy test series
what they want to tell and it is true or false?
what they want to tell and it is true or false?
Ray Tomlinson
272
views
Ray Tomlinson
asked
Aug 9, 2023
Algorithms
made-easy-test-series
made-easy-booklet
algorithms
bellman-ford
+
–
0
votes
1
answer
139
Made Easy Test Series 2024
How many times is the comparison $i >= n$ performed in the following program? int i = 200 n = 80; main() { while (i >= n) { i = i - 2 n = n + 1 } }
How many times is the comparison $i >= n$ performed in the following program?int i = 200 n = 80; main() { while (i >= n) { i = i - 2 n = n + 1 } }
Ray Tomlinson
461
views
Ray Tomlinson
asked
Aug 9, 2023
Algorithms
algorithms
algorithm-design
loop-invariants
loop
time-complexity
+
–
2
votes
1
answer
140
Made Easy Test Series
You are given an array of elements where each array element represents the MAXIMUM number of jumps that can be made in the forward direction from that element. Now, consider the following array: {1, 3, 5, 8, 9, 2, 6, 7, 6). What is the minimum number of jumps required to reach the end of the array?
You are given an array of elements where each array element represents the MAXIMUM number of jumps that can be made in the forward direction from that element. Now, consi...
Ray Tomlinson
868
views
Ray Tomlinson
asked
Aug 9, 2023
Algorithms
made-easy-test-series
made-easy-booklet
algorithms
data-structures
array
algorithm-design
+
–
1
votes
1
answer
141
Made Easy Test Series 2024
Which of the following statement(s) is/are true? (a) Quicksort and merge sort are both examples of divide and conquer algorithms. (b) If we randomly choose a pivot element each time, quicksort will always terminate in time $O(n log n).$ (c) For every fixed ... in time $O(1)$, quicksort would have worst case complexity $O(n log n)$. plese give answer and explain it why ?
Which of the following statement(s) is/are true?(a) Quicksort and merge sort are both examples of divide and conquer algorithms.(b) If we randomly choose a pivot element ...
Ray Tomlinson
870
views
Ray Tomlinson
asked
Aug 9, 2023
Algorithms
made-easy-test-series
made-easy-booklet
algorithms
divide-and-conquer
quick-sort
merge-sort
time-complexity
+
–
0
votes
1
answer
142
Made Easy Test Series 2024
Numerical Answer Type Que? (please Try to give some ahortcut trick also or important concept is there to solve that question )
Numerical Answer Type Que?(please Try to give some ahortcut trick also or important concept is there to solve that question )
Ray Tomlinson
509
views
Ray Tomlinson
asked
Aug 9, 2023
Algorithms
made-easy-test-series
made-easy-booklet
algorithms
hashing
linear-probing
algorithm-design
+
–
0
votes
1
answer
143
Made Easy Test Series 2024
pls give all possible sequences possible for prims algo
pls give all possible sequences possible for prims algo
Ray Tomlinson
377
views
Ray Tomlinson
asked
Aug 8, 2023
Algorithms
made-easy-test-series
made-easy-booklet
algorithms
prims-algorithm
minimum-spanning-tree
+
–
0
votes
1
answer
144
#Graph Theory
Çșȇ ʛấẗẻ
307
views
Çșȇ ʛấẗẻ
asked
Aug 3, 2023
Algorithms
graph-theory
discrete-mathematics
algorithms
+
–
Page:
« prev
1
2
3
4
5
6
7
8
9
10
...
118
next »
Email or Username
Show
Hide
Password
I forgot my password
Remember
Log in
Register