Login
Register
Dark Mode
Brightness
Profile
Edit Profile
Messages
My favorites
My Updates
Logout
Webpage for Algorithms
Recent questions tagged algorithms
0
votes
0
answers
1141
Short cut to calculate d (private key) ins RSA algorithm
Please tell me shortcut to calculate d (private key) in RSA Algorithm
Please tell me shortcut to calculate d (private key) in RSA Algorithm
Fida
1.9k
views
Fida
asked
Nov 13, 2018
Computer Networks
rsa
algorithms
cryptography
+
–
0
votes
0
answers
1142
Breadth First Search(BFS)
$0-1$ $BFS$ (Breadth First Search)al is used to find the shortest distance between two nodes in a graph provided that the edges in the graph have the weights $0$ or $1.$Which of the following data structure is most efficient in traversing a graph by $0-1$ $BFS?$ $A)$ Priority queue $B)$Stack $C)$ Double-ended queue $D)$ Linked list
$0-1$ $BFS$ (Breadth First Search)al is used to find the shortest distance between two nodes in a graph providedthat the edges in the graph have the weights $0$ or $1.$Wh...
Lakshman Bhaiya
435
views
Lakshman Bhaiya
asked
Nov 13, 2018
Algorithms
algorithms
graph-algorithm
breadth-first-search
+
–
0
votes
1
answer
1143
Graph Search
Which of the following statements are true? In a depth-first search of an undirected graph $G,$every edge of $G$ is either a tree edge or a back edge Forward and cross edges never occur in a depth-first search of an undirected graph A directed graph is acyclic if and only if a depth-first search yields no back edges $1$ $1$ and $2$ $2$ and $3$ All of these
Which of the following statements are true? In a depth-first search of an undirected graph $G,$every edge of $G$ is either a tree edge or a back edgeForward and cross edg...
Lakshman Bhaiya
543
views
Lakshman Bhaiya
asked
Nov 13, 2018
Algorithms
algorithms
graph-algorithm
depth-first-search
+
–
0
votes
0
answers
1144
Depth First Search (DFS)
Consider the following sequence of nodes for the undirected graph given below$:$ $(1)PQSTWVUR$ $(2)PQRSTUWV$ $(3)PQRTUSVW$ A Depth First Search (DFS) is started at node $P.$The nodes are listed in the order they are first visited. Which all of the above are possible outputs$?$ $A)Only (2)$ $B)(1) and (2)$ $C)(2) and (3)$ $D)(1) and (2)$
Consider the following sequence of nodes for the undirected graph given below$:$$(1)PQSTWVUR$$(2)PQRSTUWV$$(3)PQRTUSVW$A Depth First Search (DFS) is started at node $P.$T...
Lakshman Bhaiya
808
views
Lakshman Bhaiya
asked
Nov 13, 2018
Algorithms
algorithms
graph-algorithm
depth-first-search
+
–
0
votes
2
answers
1145
Fibonacci number time complexity
Consider the following code segment to find the $n^{th}$ Fibonacci number: Fib(n) { if(n==0) {return 0;} if(n==1) {return 1;} else { return(Fib(n-1) + Fib(n-2)); } } The time complexity of the above code and time complexity of the same problem solved using dynamic programming is______ $A)O(n^{2}),O(n)$ $B)O(2^{n}),O(n)$ $C)O(2^{n}),O(n^{2})$ $D)$None of the above
Consider the following code segment to find the $n^{th}$ Fibonacci number:Fib(n) { if(n==0) {return 0;} if(n==1) {return 1;} else { return(Fib(n-1) + Fib(n...
Lakshman Bhaiya
2.8k
views
Lakshman Bhaiya
asked
Nov 13, 2018
Algorithms
algorithms
greedy-algorithm
dynamic-programming
+
–
0
votes
0
answers
1146
chache performance between hoare and loranto quicksort
between hoare and loranto quicksort which give better cache performance ? we know that in hoare quicksort we move the pointer i,j in different direction but in loranto quicksort we move i,j in same direction so the cache performance of loranto should be better?
between hoare and loranto quicksort which give better cache performance ?we know that in hoare quicksort we move the pointer i,j in different direction but in loranto qui...
Gurdeep Saini
289
views
Gurdeep Saini
asked
Nov 13, 2018
Algorithms
algorithms
sorting
quick-sort
+
–
4
votes
3
answers
1147
Job Sequencing Problem (Greedy Algorithm)
If job $J=(J_{1},J_{2},J_{3},J_{4})$ are given their processing time $T_{i}=(1,1,2,3)$ and deadline are $D_{i}=(3,4,2,3)$ maximum how many job can be done$?$ $A)1$ $B)2$ $C)3$ $D)All$
If job $J=(J_{1},J_{2},J_{3},J_{4})$ are given their processing time $T_{i}=(1,1,2,3)$ and deadline are $D_{i}=(3,4,2,3)$ maximum how many job can be done$?$$A)1$ ...
Lakshman Bhaiya
12.3k
views
Lakshman Bhaiya
asked
Nov 10, 2018
Algorithms
algorithms
greedy-algorithm
algorithm-design
job-scheduling
+
–
0
votes
0
answers
1148
Find the weight MST
Let us assume that $G$($V$, $E$) is a weighted complete graph such that weight of the edge <$V_K$,$V_L$>=2|$K$-$L$|. The weight MST of $G$ with 100 vertices is ____________________.
Let us assume that $G$($V$, $E$) is a weighted complete graph such that weight of the edge <$V_K$,$V_L$>=2|$K$-$L$|. The weight MST of $G$ with 100 vertices is __________...
Naveen Kumar 3
629
views
Naveen Kumar 3
asked
Nov 10, 2018
Algorithms
algorithms
minimum-spanning-tree
+
–
0
votes
0
answers
1149
How to solve this:
Consider the following set of identifiers <a1 a2 a3> = <do, if, while> with probabilities <P1-P3> = <0.5, 0.1, 0.05> , <Q0-Q3>=<0.15, 0.1, 0.05, 0.05>. The cost of following Binary search tree is
Consider the following set of identifiers <a1 a2 a3 = <do, if, while with probabilities<P1-P3 = <0.5, 0.1, 0.05 , <Q0-Q3>=<0.15, 0.1, 0.05, 0.05>.The cost of following Bi...
Naveen Kumar 3
718
views
Naveen Kumar 3
asked
Nov 10, 2018
Algorithms
algorithms
+
–
0
votes
0
answers
1150
Minimum spanning tree implementation in other way
Which algorithm will be implemented on the weighted graph in which the edges are uniformly distributed over the half-open interval $[0,1)$ to construct MST so that it runs in linear time? $A)$ Kruskal's algorithm $B)$ Prim's algorithm $C)$ Both $(A)$ and $(B)$ $D)$ None of these
Which algorithm will be implemented on the weighted graph in which the edges are uniformly distributed over the half-open interval $[0,1)$ to construct MST so that it run...
Lakshman Bhaiya
497
views
Lakshman Bhaiya
asked
Nov 10, 2018
Algorithms
algorithms
graph-algorithm
minimum-spanning-tree
+
–
0
votes
2
answers
1151
please explain also..
Mak Indus
369
views
Mak Indus
asked
Nov 10, 2018
Algorithms
algorithms
kruskals-algorithm
+
–
0
votes
2
answers
1152
why do we need O(n), we can do directy check if index is present or not in O(1) time. Please explain..
Given an array of distinct integers A[1, 2,…n]. Find the tightest upper bound to check the existence of any index i for which A[i]= i.(a) O (1) ...
Mak Indus
254
views
Mak Indus
asked
Nov 10, 2018
Algorithms
algorithms
time-complexity
+
–
0
votes
1
answer
1153
Self doubt Spanning tree
How many numbers of spanning tree are possible?
How many numbers of spanning tree are possible?
Lakshman Bhaiya
1.0k
views
Lakshman Bhaiya
asked
Nov 8, 2018
Algorithms
algorithms
minimum-spanning-tree
+
–
2
votes
1
answer
1154
Spanning Tree
How to count the number of spanning tree?
How to count the number of spanning tree?
Lakshman Bhaiya
1.4k
views
Lakshman Bhaiya
asked
Nov 8, 2018
Algorithms
algorithms
minimum-spanning-tree
+
–
0
votes
0
answers
1155
Karumanchi
f(n)=$2^n$ g(n)=n! h(n)=$n^{logn}$ which one is true? A) f(n)=O(g(n)) and g(n)=O(h(n)) B) f(n)=$\Omega(g(n)))$ and g(n)=O(h(n)) C) g(n)=O(f(n)) and h(n)=O(f(n)) D) h(n)=O(f(n)) and g(n)=$\Omega(f(n))$
f(n)=$2^n$g(n)=n!h(n)=$n^{logn}$ which one is true?A) f(n)=O(g(n)) and g(n)=O(h(n))B) f(n)=$\Omega(g(n)))$ and g(n)=O(h(n))C) g(n)=O(f(n)) and h(n)=O(f(n))D) h(n)=O(f(n))...
aditi19
330
views
aditi19
asked
Nov 6, 2018
Algorithms
algorithms
time-complexity
+
–
1
votes
1
answer
1156
Please Explain also..
. Assume an array A[1….n] has n-elements, and every element of an array is less than or equal to n. An element is said to be majority element, if it occurred in more than n/2 positions of an array. What is the best time complexity to check whether the majority of elements exist or not? (a) O (log n) (b) O (n) (c) O (n log n) (d) O (n2)
. Assume an array A[1….n] has n-elements, and every element of an array is less than or equal to n. An element is said to be majority element, if it occurred in more th...
Mak Indus
1.7k
views
Mak Indus
asked
Nov 6, 2018
Algorithms
algorithms
sorting
time-complexity
+
–
0
votes
1
answer
1157
Please Explain with exapmle
Consider the following pseudo code. What is the total number of multiplications to be performed? D = 2 for i = 1 to n do for j = i to n do for k = j + 1 to n do D = D * 3 (a) Half of the product of the 3 consecutive integers ... the product of the 3 consecutive integers (c) One-sixth of the product of the 3 consecutive integers (d) None of the above Solution: Option (c)
Consider the following pseudo code. What is the total number of multiplications to be performed?D = 2for i = 1 to n do for j = i to n do for k = j + 1 to n do ...
Mak Indus
400
views
Mak Indus
asked
Nov 6, 2018
Algorithms
algorithms
time-complexity
+
–
1
votes
0
answers
1158
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
2
answers
1159
double hashing
can any one explain double hashing example
can any one explain double hashing example
altamash
2.5k
views
altamash
asked
Nov 5, 2018
Algorithms
algorithms
hashing
+
–
0
votes
1
answer
1160
Please solve this recurence relation.... How we got option--a.
The recurrence equation: T(1) = 1 T(n) = 2T(n - 1) + n, n ≥ 2 evaluates to (a) 2n + 1 - n – 2 (b) 2n – n (c) 2n + 1 – 2n – 2 (d) 2n – n Solution: Option (a)
The recurrence equation:T(1) = 1T(n) = 2T(n - 1) + n, n ≥ 2evaluates to(a) 2n + 1 - n – 2 (b) 2n – n(c) 2...
Mak Indus
755
views
Mak Indus
asked
Nov 5, 2018
Algorithms
algorithms
recurrence-relation
+
–
1
votes
1
answer
1161
Algorithms revision question
Please suggest some revision or must see questions for algorithms subject. It would be helpful for me to revise. Thanks
Please suggest some revision or must see questions for algorithms subject.It would be helpful for me to revise. Thanks
Mayankprakash
352
views
Mayankprakash
asked
Nov 5, 2018
Revision
revision
algorithms
+
–
0
votes
1
answer
1162
Number of sub-strings for a given sub string having repeated symbols
Lets for a a given string aabbbccdd I need to find the number of substrings possible how to go about it? Does the n(n+1)/2 formula work here also?
Lets for a a given string aabbbccddI need to find the number of substrings possible how to go about it? Does the n(n+1)/2 formula work here also?
sripo
2.6k
views
sripo
asked
Nov 5, 2018
Theory of Computation
combinatory
counting
theory-of-computation
algorithms
finite-automata
+
–
0
votes
1
answer
1163
GateForum
Can anyone please explain
Can anyone please explain
nag.swarna
552
views
nag.swarna
asked
Nov 4, 2018
Algorithms
algorithms
radix-sort
test-series
+
–
0
votes
2
answers
1164
Karumanchi
aditi19
780
views
aditi19
asked
Nov 4, 2018
Algorithms
algorithms
time-complexity
recurrence-relation
+
–
0
votes
0
answers
1165
Find the Time Complexity
Suppose, we have an array of n elements. find the time complexity to search two elements x, y such that:- a) x+y < 100 b) x+y > 1000 Also, state the algorithm/approach for the same.
Suppose, we have an array of n elements. find the time complexity to search two elements x, y such that:-a) x+y < 100b) x+y 1000Also, state the algorithm/approach for th...
Naveen Kumar 3
931
views
Naveen Kumar 3
asked
Nov 3, 2018
Algorithms
algorithms
time-complexity
+
–
0
votes
1
answer
1166
time complexity of recursive program
What is the time complexity of the following code snippet? Assume "statement" takes $O(1)$ time. int x=0; int A(n) { statement; if(n==1)return 1; else { x + = 4A(n/2)+n^{2} return (x); } } $A)\theta(n^{2}logn)$ $B)\theta(logn)$ $C)\theta(n^{2})$ $D)\theta(nlogn)$
What is the time complexity of the following code snippet? Assume "statement" takes $O(1)$ time.int x=0; int A(n) { statement; if(n==1)return 1; else { ...
Lakshman Bhaiya
1.5k
views
Lakshman Bhaiya
asked
Nov 3, 2018
Algorithms
algorithms
time-complexity
+
–
0
votes
1
answer
1167
Time complexity of the program
Consider the following function(n) { val=0; for i=1 to n { if(n<=10000) for j=1 to n for k=1 to n val = val + 1; else for j=1 to n val = val + 1; } } The running time of the above function can best be described by $T(n)=$____________ $A)\theta(n^{3}) $ $B)\theta(n^{2})$ $C)\theta(n)$ $D)\theta(1)$
Consider the following function(n) { val=0; for i=1 to n { if(n<=10000) for j=1 to n for k=1 to n val = val + 1; else for j=1 to n val = val + 1; } } The running time of ...
Lakshman Bhaiya
679
views
Lakshman Bhaiya
asked
Nov 3, 2018
Algorithms
algorithms
time-complexity
+
–
0
votes
0
answers
1168
A is polynomially reducible to B
Let there be two problems $A$ and $B$ It has been proved that,$A<B$ i.e. $A$ is polynomially reducible to $B.$This polynomial reduction is carried out in time of $O(n).$The problem $B$ can be solved in $O(n^{3})$ time. what is the time taken to solve problem $'A'?$ $A)O(n)$ $A)O(n^{3})$ $A)O(2^{n})$ $D)$None of these
Let there be two problems $A$ and $B$It has been proved that,$A<B$ i.e. $A$ is polynomially reducible to $B.$This polynomialreduction is carried out in time of $O(n).$The...
Lakshman Bhaiya
784
views
Lakshman Bhaiya
asked
Nov 3, 2018
Algorithms
algorithms
time-complexity
+
–
0
votes
0
answers
1169
Runnig time on algorithm
What is the smallest value of $n$ (where $n$ is a natural number) such that an algorithm whose running time is $100\sqrt{n}$ runs faster than an algorithm whose running time is $2^{\frac{n}{2}}$ on the same machine?
What is the smallest value of $n$ (where $n$ is a natural number) such that an algorithm whose running time is $100\sqrt{n}$ runs faster than an algorithm whose running t...
Lakshman Bhaiya
254
views
Lakshman Bhaiya
asked
Nov 1, 2018
Algorithms
algorithms
time-complexity
+
–
0
votes
0
answers
1170
Self doubt on Asymptotic Notations
The iterated logarithmic function is defined as: $logn=0;$ $if$ $n\leq1$ $(or)$ $logn=1+log(logn);$ $if$ $n>1$ Which of the following is/are $True?$ $(1)logn=O(log(logn))$ $(2)(logn)!=O(logn)$ $(3) logn)^{n}=O((logn)!)$ $A)(1)$ $and$ $(2)$only$ $B)(1) and (3) only $ $C)(2)$ $and$ $(3)$ $only $ $D)(1),(2)$ $and$ $(3) $
The iterated logarithmic function is defined as:$logn=0;$ $if$ $n\leq1$ $(or)$ $logn=1+log(logn);$ $if$ $n>1$Which of the following is/are $True?$$(1)logn=O(log(logn))...
Lakshman Bhaiya
218
views
Lakshman Bhaiya
asked
Nov 1, 2018
Algorithms
algorithms
time-complexity
+
–
Page:
« prev
1
...
34
35
36
37
38
39
40
41
42
43
44
...
118
next »
Email or Username
Show
Hide
Password
I forgot my password
Remember
Log in
Register