Recent questions tagged algorithms

417
views
0 answers
1 votes
Consider the assertions$\text{(A1)}$ Given a directed graph $G$ with positive weights on the edges, two special vertices $s$ and $t$, and an integer $k$ ... $\text{A2}$ does not imply $\text{A1}$None of the above.
455
views
0 answers
2 votes
Consider the following function $\textsf{count},$ that takes as input $a,$ an array of integers, and $\textsf{N}$, the size of the array.int count(int a[], int N) ... of size $\textsf{N, count_FN} \geq \textsf{N}^2 / c$None of the above
314
views
0 answers
1 votes
Consider a directed graph $G=(V, E)$, where each edge $e \in E$ has a positive edge weight $c_e$. Determine the appropriate choices for the blanks below so that the value of ... blank }2:\; \geq$\text{blank }1: \min, \text{blank }2:\; =$
285
views
0 answers
0 votes
T(n) = 2^nT(n/2) + n^n find TC
445
views
1 answers
2 votes
Can anyone please explain how to find “ i “ smallest elements from an array whose elements are distinctPlease use max heap to explain the working input : n distinct elements output : i smallest elements
499
views
0 answers
0 votes
Consider f(n) and g(n) be asymptotic non-negative functions. So here can we say that min(f(n), g(n)) = Θ(f(n) + g(n))My proof for thisFor f(n) = Θ(g(n))c1* ... g(n)) = Θ(f(n) + g(n))Is this the correct way? What would be the correct answer?
527
views
1 answers
1 votes
How To Solve This Using Divide And ConquerSuppose we are given the two n bit integers, assuming for common sense n as power of 2. It is required to multiply them using Divide & conquer method. ... 4T(n/2) + O(n^2)4. T(n) = 4T(n/2) + O(n)
380
views
0 answers
2 votes
Consider the following algorithm,Dosomething( x, n){m= n, temp= 1,z= x;while(m>0) do{while((m mod z)=0) do{m= Floor(m/2);z=z^2;}m = m-1, ... z;}return temp;}The complexity of above algorithm isTheta(log n)Theta(n log n)Theta(n^2)Theta(n)
916
views
1 answers
0 votes
int max(int a, int b) { return (a > b) ? a : b; }// Returns the maximum value that can be// put in a knapsack of capacity Wint knapSack ... );} This statement implies that the max value return by the two different recursive problems right?
729
views
1 answers
1 votes
as we allocate the space for node in linked list using malloc() so how many bytes malloc allocate for the 1 node i.e. actual value of malloc allocates in ram like ... )); printf("%d",sizeof(struct node)); } what the printf prints and why ?
1.1k
views
2 answers
0 votes
A hash table of size 10 using open addressing with linear probing and hash function is h(k)= (k)mod10 , where k is key value , initially table is ... 20,67How many number of probes required to insert 17 in table after inserting above keys?
503
views
1 answers
0 votes
The number of operations in matrix multiplication $\text{M1, M2, M3, M4}$ and $\text{M5}$ of sizes $5\times 10, 10\times 100, 100\times 2, 2\times 20$ and $20\times 50$ respectively will be:$5830$4600$6900$12890$
508
views
1 answers
1 votes
BigO notation ofT(n)=T(n-1)+ √n ; n>=1 =0. ; Otherwise
376
views
1 answers
0 votes
Please list the problems where BFS alone can do and DFS alone can do and both can do??