Can someone please help me to solve this using recursion tree method, I am trying it but unable to solve it. T(N) = sqrt( N ) T( sqrt( N ) ) + sqrt( N )
# | User | Rating |
---|---|---|
1 | tourist | 3985 |
2 | jiangly | 3814 |
3 | jqdai0815 | 3682 |
4 | Benq | 3529 |
5 | orzdevinwang | 3526 |
6 | ksun48 | 3517 |
7 | Radewoosh | 3410 |
8 | hos.lyric | 3399 |
9 | ecnerwala | 3392 |
9 | Um_nik | 3392 |
# | User | Contrib. |
---|---|---|
1 | cry | 169 |
2 | maomao90 | 162 |
2 | Um_nik | 162 |
4 | atcoder_official | 161 |
5 | djm03178 | 158 |
6 | -is-this-fft- | 157 |
7 | adamant | 155 |
8 | awoo | 154 |
8 | Dominater069 | 154 |
10 | luogu_official | 150 |
Can someone please help me to solve this using recursion tree method, I am trying it but unable to solve it. T(N) = sqrt( N ) T( sqrt( N ) ) + sqrt( N )
We have designed an new algorithm to sort a list of n numbers. We recursively partition the numbers into groups of size sqrt(n) each until we are left with lists of constant size; at which point we use insertion sort to sort the numbers. To combine solutions, we do a merge of the sorted lists, namely maintaining pointers to the start of the list and at each step advancing the pointer of the list corresponding to the smallest element. Let T(n) denote the running time of this algorithm (we can assume that sqrt(k) is an integer for all k<=n encountered in the algorithm).
Running time : T(n) <= sqrt(n) T( sqrt(n) ) + O(n^1.5)
I can think of it as T(n) = T( sqrt(n) ) + T( n-sqrt(n) ) + O(n) but can't relate to the solution. Plz can anybody explain its running time.
Can anybody plz explain why the upper bound of n in problem Primes or Palindromes? is 10^7. I have spent a whole day but coul not figure out. Plz can someone explain rigourously.
Why this compiles: Plz guide me on this:
int main() {
for(int i = 0; 0; i++) {
cout<<"H"; }
}
Can u elaborate the working of this code?
In java 8, all the commands of java 7 work or not.
I am asking this question because in c++ 11 #define tr(c,it) for(typeof(c.begin()) it=c.begin();it!=c.end();++it) does not work while in c++4.9.2 it works.
So I wanted to know which one is better java 8 or 7 and if java 8 then all commands of java 7 work on it or not. Plz help me in this.
If N and M are used as double, then for comparing them, can we do this:
if( N<=M ) { cout << "Yes"; }
If not then suggest what to do?
If N is long long and M is double, then for comparing them, can we do this:
if( N<=M ) { cout << "Yes"; }
If not then suggest what to do?
Comparison with double is causing me problem. So guide me what to do?
Can anybody plz ezplain:
for(int i = 1; i <= n; i++) { scanf("%s", a[i] + 1); }
I know this one
for(int i = 1; i <= n; i++) { scanf("%s", a[i] ); }
But I don't know the use of above scanf("%s", a[i] + 1); Plz guide me on this.
Can someone please explain me lower_bound and upper_bound and how they are used in sorted array? Please explain in depth.
Name |
---|