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
3121
Please help
Can someone plz help me understand union find algo? Or provide a good resource other thah GfGeeks,for this
Can someone plz help me understand union find algo?Or provide a good resource other thah GfGeeks,for this
Gate Mm
339
views
Gate Mm
asked
Dec 11, 2015
Algorithms
algorithms
union-find
+
–
1
votes
2
answers
3122
Infix expression evaluation complexity
What is the complexity of evaluating an infix expression having n operators?
What is the complexity of evaluating an infix expression having n operators?
bahirNaik
2.8k
views
bahirNaik
asked
Dec 11, 2015
Programming in C
stack
algorithms
time-complexity
+
–
0
votes
0
answers
3123
what is the effect of problem size of the complexity of divide and conquer algorithms and why ?
Considering the partition algorithm in quick-sort , depending on any input sequence it will be called n times only so then what is the usage of dividing the problem into equal halfs , through recurrence relation ... to be divided at each level in equal halfs but I am not getting logic behind this .
Considering the partition algorithm in quick-sort , depending on any input sequence it will be called n times only so then what is the usage of dividing the problem into...
radha gogia
265
views
radha gogia
asked
Dec 9, 2015
Algorithms
algorithms
+
–
1
votes
1
answer
3124
why does quick-sort work better than merge-sort for small inputs ?
radha gogia
609
views
radha gogia
asked
Dec 8, 2015
Algorithms
sorting
algorithms
normal
+
–
17
votes
2
answers
3125
TIFR CSE 2015 | Part B | Question: 3
Consider the following code fragment in the $C$ programming language when run on a non-negative integer $n$. int f (int n) { if (n==0 || n==1) return 1; else return f (n - 1) + f(n - 2); } Assuming a typical implementation ... $n$. This algorithm runs in polynomial time in $n$ and the optimal running time is polynomial in $n$. The algorithm does not terminate.
Consider the following code fragment in the $C$ programming language when run on a non-negative integer $n$.int f (int n) { if (n==0 || n==1) return 1; else return f (n -...
makhdoom ghaya
1.8k
views
makhdoom ghaya
asked
Dec 7, 2015
Algorithms
tifr2015
algorithms
identify-function
time-complexity
+
–
29
votes
2
answers
3126
TIFR CSE 2015 | Part B | Question: 2
Consider the following undirected connected graph $G$ with weights on its edges as given in the figure below. A minimum spanning tree is a spanning tree of least weight and a maximum spanning tree is one with largest weight. A second best ... tree here. There is unique minimum spanning tree, however there is more than one second-best minimum spanning tree here.
Consider the following undirected connected graph $G$ with weights on its edges as given in the figure below. A minimum spanning tree is a spanning tree of least weight a...
makhdoom ghaya
3.6k
views
makhdoom ghaya
asked
Dec 7, 2015
Algorithms
tifr2015
algorithms
graph-algorithms
minimum-spanning-tree
+
–
22
votes
3
answers
3127
TIFR CSE 2015 | Part B | Question: 1
Consider the following recurrence relation: $T(n) = \begin{cases} 2T (\lfloor\sqrt{n}\rfloor)+ \log n & \text{if }n \geq 2 \\ 1& \text{if }n = 1 \end{cases}$ Which of the following statements is TRUE? $T(n)$ is $O(\log n)$. $T(n)$ ... but not $O(\log^{3/2} n)$. $T(n)$ is $O(\log^{2} n \cdot \log \log n)$ but not $O(\log^{2} n)$.
Consider the following recurrence relation:$T(n)= \begin{cases}2T (\lfloor\sqrt{n}\rfloor)+ \log n & \text{if }n \geq 2 \\ 1& \text{if }n = 1 \end{cases}$Which of the...
makhdoom ghaya
3.0k
views
makhdoom ghaya
asked
Dec 5, 2015
Algorithms
tifr2015
algorithms
recurrence-relation
time-complexity
+
–
3
votes
2
answers
3128
Binary Search - Average Number of Comparisons.
Let you are given an array of nine elements in increasing order. If you want to implement binary search on the given array of element then the number of comparisons per successful search on an average will be: Average is 2.78, should I answer this question with or without rounding off 2.78, as number of comparisons is an integral value?
Let you are given an array of nine elements in increasing order. If you want to implement binary search on the given array of element then the number of comparisons per s...
अनुराग पाण्डेय
2.3k
views
अनुराग पाण्डेय
asked
Dec 5, 2015
Algorithms
binary-search
algorithms
numerical-answers
allen-test-series
+
–
2
votes
2
answers
3129
what is the time complexity
priyavssut
408
views
priyavssut
asked
Dec 5, 2015
Algorithms
algorithms
time-complexity
made-easy-test-series
+
–
2
votes
1
answer
3130
asymptotic notation
show that k lnk =ϴ(n) then k=ϴ(n/lg n)
show that k lnk =ϴ(n) then k=ϴ(n/lg n)
Pooja Palod
293
views
Pooja Palod
asked
Dec 5, 2015
Algorithms
algorithms
asymptotic-notation
+
–
3
votes
1
answer
3131
Insertion sort on small arrays in merge sort
Although merge sort runs in Θ(n lg n) worst-case time, and insertion sort runs in Θ(n 2 ) worst-case time, the constant factors in insertion sort make it faster for small n. Thus, it makes sense to ... for which the modified algorithm has the same asymptotic running time as standard merge sort? d.How should we choose k in practice?
Although merge sort runs in Θ(n lg n) worst-case time, and insertion sort runs in Θ(n 2 ) worst-case time, the constant factors in insertion sort make it fast...
Pooja Palod
2.0k
views
Pooja Palod
asked
Dec 5, 2015
Algorithms
sorting
algorithms
+
–
1
votes
2
answers
3132
Computing the value of P
Himanshu1
578
views
Himanshu1
asked
Dec 4, 2015
Algorithms
algorithms
identify-function
made-easy-test-series
+
–
16
votes
3
answers
3133
Find address of element in 3d array
A is an array $[2.....6, 2.....8, 2.......10]$ of elements. The starting location is $500$. The location of an element $A(5, 5, 5)$ using column major order is __________.
A is an array $[2.....6, 2.....8, 2.......10]$ of elements. The starting location is $500$. The location of an element $A(5, 5, 5)$ using column major order is __________...
shikharV
15.5k
views
shikharV
asked
Dec 4, 2015
DS
data-structures
array
algorithms
+
–
2
votes
1
answer
3134
MadeEasy Test Series: Algorithms - Time Complexity
Q.19 Consider the following function. What is the worst case running time of the function f for any positive value of n? O(1) O(n) O(n2) O(n3)
Q.19Consider the following function.What is the worst case running time of the function f for any positive value of n?O(1)O(n)O(n2)O(n3)
Akash Kanase
490
views
Akash Kanase
asked
Dec 4, 2015
Algorithms
algorithms
time-complexity
made-easy-test-series
+
–
1
votes
2
answers
3135
asymtotic notations
Q). Consider the following functions $f_1 = n^{\frac{4}{3}}$ $f_2=2^{2^n}$ $f_3= 2^{n^2}$ $f_4= n!$ $f_5=2^n$ Which of the following is true? A). $f_1$ is $\Omega(f_2)$ B). $f_2$ is $O(f_3)$ C). $f_1<f_5<f_4<f_2<f_3$ D). $f_4$ is $O(f_3)$
Q). Consider the following functions$f_1 = n^{\frac{4}{3}}$$f_2=2^{2^n}$$f_3= 2^{n^2}$$f_4= n!$$f_5=2^n$Which of the following is true?A). $f_1$ is $\Omega(f_2)$B). $f_2$...
shreshtha5
672
views
shreshtha5
asked
Dec 3, 2015
Algorithms
algorithms
asymptotic-notation
+
–
1
votes
1
answer
3136
Finding complexity in case ratio of two compexity is constant.
Given two positive functions f(n) and g(n). If $\frac{f(n)}{g(n)}=c$, for some constant c ≥ 0 and c is non-negative but not infinite then which of the following is correct? f(n) = O(g(n)) f(n) = θ (g(n)) ... are of same order. In that case they are both upper & lower bounds of each other ! Q 47 From Made Easy FLT 6-Practice Test 14
Given two positive functions f(n) and g(n). If $\frac{f(n)}{g(n)}=c$, for some constant c ≥ 0 and c is non-negative but not infinite then which of the following is corr...
Akash Kanase
670
views
Akash Kanase
asked
Dec 1, 2015
Algorithms
algorithms
time-complexity
made-easy-test-series
+
–
3
votes
1
answer
3137
Recurrence: How to approach
Solve Recurrence A) T(n) = T( √ n) + Θ(lg lg n) B) T(n) = T(n/2 + √ n) + √ 6046 C) T(n) = T(n − 2) + lg n D) T(n) = √ n T( √ n) + 100n
Solve RecurrenceA) T(n) = T( √ n) + Θ(lg lg n)B) T(n) = T(n/2 + √ n) + √ 6046C) T(n) = T(n − 2) + lg nD) T(n) = √ n T( √ n) + 100n
Prasanna
1.6k
views
Prasanna
asked
Nov 26, 2015
Algorithms
master-theorem
algorithms
recurrence-relation
+
–
2
votes
2
answers
3138
Difficult Reccurance
Solve the recurrences. A) T(1) = 1, T(2) = 6, T(3) = 13, and for all n ≥ 4, T(n) = T(n − 3) + 5n − 9. B) T(1) = 1, and for all n ≥ 2, T(n)=2T(n − 1) + n2 − 2n + 1.
Solve the recurrences.A) T(1) = 1, T(2) = 6, T(3) = 13, and for all n ≥ 4, T(n) = T(n − 3) + 5n − 9.B) T(1) = 1, and for all n ≥ 2, T(n)=2T(n − ...
Prasanna
488
views
Prasanna
asked
Nov 26, 2015
Algorithms
difficult
recurrence-relation
algorithms
+
–
2
votes
2
answers
3139
substitution or Master Method
What to use for this Master or Substitution Method ? T(1) = 1, and for all n ≥ 2 a power of 2, T(n)=2T(n/2) + 6n − 1. If it is possible in Master Method how ? Even,Substitution is also accecpted here. Edit: In substitution Method Suppose T(1) = 1, and ... = n + 6n log n − (2log n − 1) = 6n log n + 1.
What to use for this Master or Substitution Method ?T(1) = 1, and for all n ≥ 2 a power of 2, T(n)=2T(n/2) + 6n − 1.If it is possible in Master Method how ?Even,...
Prasanna
1.6k
views
Prasanna
asked
Nov 25, 2015
Algorithms
algorithms
recurrence-relation
master-theorem
+
–
2
votes
2
answers
3140
RECURRENCES 1
How to solve ? T(1) = 8, and for all n ≥ 2, T(n)=3T(n − 1) − 15. My Attempt: T(n)=3T(n − 1) - 15 (after one substitution) = 3(3T(n − 2) - 15) - 15 = 9T(n − 2) - 15 · 3 -15 (after two substitutions) = 9(3T(n − 3) - 15) - 15 · 3 - 15 = 27T(n − 3) - 15 · 9- 15 · 3 - 15 (after three substitutions). After this How to approach ?
How to solve ?T(1) = 8, and for all n ≥ 2, T(n)=3T(n − 1) − 15. My Attempt:T(n)=3T(n − 1) - 15 (after one substitution)= 3(3T(n − 2) - 15) - 15= 9T(n − 2) - 1...
Prasanna
1.7k
views
Prasanna
asked
Nov 25, 2015
Algorithms
recurrence-relation
algorithms
normal
+
–
1
votes
1
answer
3141
Bits Required
A) How many bits do you need to write 10^n in binary? B) How many bits are required to represent the nth Fibonacci number in binary?
A) How many bits do you need to write 10^n in binary?B) How many bits are required to represent the nth Fibonacci number in binary?
Prasanna
501
views
Prasanna
asked
Nov 24, 2015
CO and Architecture
algorithms
co-and-architecture
normal
+
–
7
votes
2
answers
3142
Asymptotic notations
The increasing order of following functions in terms of asymptotic complexity is: $\large \\ f_1(n)= n^{0.999999} \log n \qquad // \log n \text{ is not power of } n\\ f_2(n)=10000000*n \\ f_3(n)=10000000^n\\ f_4(n)=n^2$ (a) f1(n); f4(n); f2(n); f3(n) (b) f1(n); f2(n); f3(n); f4(n) (c) f2(n); f1(n); f4(n); f3(n) (d) f1(n); f2(n); f4(n); f3(n)
The increasing order of following functions in terms of asymptotic complexity is:$\large \\ f_1(n)= n^{0.999999} \log n \qquad // \log n \text{ is not power of } n\\ f_2(...
Registered user 1
7.6k
views
Registered user 1
asked
Nov 24, 2015
Algorithms
algorithms
time-complexity
+
–
1
votes
2
answers
3143
time complexity
$\sum\limits_{i=0}^n i^{3} = X$ and following choices for X 1.$\Theta(n^4)$ 2.$\Theta(n^5)$ 3. $O(n^5)$ 4.$\Omega(n^3)$ possible values of $X$
$\sum\limits_{i=0}^n i^{3} = X$and following choices for X1.$\Theta(n^4)$2.$\Theta(n^5)$3. $O(n^5)$4.$\Omega(n^3)$possible values of $X$
tiger
561
views
tiger
asked
Nov 24, 2015
Algorithms
algorithms
time-complexity
multiple-selects
+
–
1
votes
1
answer
3144
Probability:You are given a deck of fifty two cards which have printed on them a pair of symbols
You are given a deck of fifty two cards which have printed on them a pair of symbols: an integer between 1 and 13, followed by one of the letters “S,” “H,” ... them, but otherwise all cards are randomly distributed. Now what is the average cost of finding [11,H]?
You are given a deck of fifty two cards which have printed on them a pair of symbols: an integer between 1 and 13, followed by one of the letters “S,” “...
Prasanna
548
views
Prasanna
asked
Nov 24, 2015
Probability
probability
algorithms
+
–
30
votes
4
answers
3145
What is/was your strategy for GATE Preparation?
Frequently it has been found that people ask each other or at least try to read about/ hear from others about how are they preparing for GATE. This question is a place where you should share answers to : What is your formula for ... , What is the critical point of advice. you prefer to give Any other relevant info. that you can come up with
Frequently it has been found that people ask each other or at least try to read about/ hear from others about how are they preparing for GATE.This question is a place whe...
amarVashishth
7.0k
views
amarVashishth
asked
Nov 23, 2015
Study Resources
study-resources
databases
theory-of-computation
engineering-mathematics
operating-system
algorithms
co-and-architecture
+
–
1
votes
1
answer
3146
Dijkatra algorithm for unweighted graph
hi all , Please tell me how much does dijkastra algoritm would take for unwaited and martix implementation
hi all ,Please tell me how much does dijkastra algoritm would take for unwaited and martix implementation
Piyush Kapoor
279
views
Piyush Kapoor
asked
Nov 23, 2015
Algorithms
algorithms
greedy-algorithm
dijkstras-algorithm
+
–
2
votes
3
answers
3147
job scheduling
shreshtha5
2.3k
views
shreshtha5
asked
Nov 22, 2015
Algorithms
algorithms
greedy-algorithm
job-scheduling
numerical-answers
test-series
+
–
1
votes
1
answer
3148
Recurrence relation
How to solve the Recurrence relation T(n)=T(n/4)+T(3n/4)+n
How to solve the Recurrence relation T(n)=T(n/4)+T(3n/4)+n
Soumyashree
447
views
Soumyashree
asked
Nov 21, 2015
Algorithms
algorithms
recurrence-relation
master-theorem
+
–
1
votes
1
answer
3149
Algorithm
When s be a sorted array of n integers , and t(n) s the time taken for the most efficient algorithm to determine if there are 2 elements with sum less than 1000 in s, then which of the following statements is true? t(n) is O(1) n<=t(n)<= n logn n logn<= t(n) <(n/2) t(n) =(n/2)
When s be a sorted array of n integers , and t(n) s the time taken for the most efficient algorithm to determine if there are 2 elements with sum less than 1000 in s, the...
Soumyashree
340
views
Soumyashree
asked
Nov 21, 2015
Algorithms
algorithms
sorting
time-complexity
+
–
40
votes
4
answers
3150
TIFR CSE 2014 | Part B | Question: 20
Consider the following game. There is a list of distinct numbers. At any round, a player arbitrarily chooses two numbers $a, b$ from the list and generates a new number $c$ by subtracting the smaller number from the larger one. The numbers $a$ and $b$ are put ... $273$. What is the score of the best player for this game? $40$ $16$ $33$ $91$ $123$
Consider the following game. There is a list of distinct numbers. At any round, a player arbitrarily chooses two numbers $a, b$ from the list and generates a new number $...
makhdoom ghaya
3.2k
views
makhdoom ghaya
asked
Nov 20, 2015
Algorithms
tifr2014
algorithms
identify-function
+
–
Page:
« prev
1
...
100
101
102
103
104
105
106
107
108
109
110
...
118
next »
Email or Username
Show
Hide
Password
I forgot my password
Remember
Log in
Register