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 )
№ | Пользователь | Рейтинг |
---|---|---|
1 | tourist | 4009 |
2 | jiangly | 3823 |
3 | Benq | 3738 |
4 | Radewoosh | 3633 |
5 | jqdai0815 | 3620 |
6 | orzdevinwang | 3529 |
7 | ecnerwala | 3446 |
8 | Um_nik | 3396 |
9 | ksun48 | 3390 |
10 | gamegame | 3386 |
Страны | Города | Организации | Всё → |
№ | Пользователь | Вклад |
---|---|---|
1 | cry | 167 |
2 | Um_nik | 163 |
3 | maomao90 | 162 |
3 | atcoder_official | 162 |
5 | adamant | 159 |
6 | -is-this-fft- | 158 |
7 | awoo | 157 |
8 | TheScrasse | 154 |
9 | Dominater069 | 153 |
9 | nor | 153 |
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.
Название |
---|