Блог пользователя jaigurudev

Автор jaigurudev, история, 5 лет назад, По-английски

I have an array of N integers (a[N]). I start removing numbers from the array one by one. If at any point I remove an element a[i] and the sum of the remaining numbers is S, then the happiness increases by an amount of S/a[i]. What is the expected value of the total happiness ?

Initial happiness can be considered as 0.

Полный текст и комментарии »

  • Проголосовать: нравится
  • +1
  • Проголосовать: не нравится

Автор jaigurudev, история, 8 лет назад, По-английски

I have studied the theoritical working of various operations on splay trees. But I am not able to find any practice questions on any platforms. Are there any problems to practice. Is it that splay trees are just for theoritical purpose without any practical use — just like AVL or RB trees ?

Полный текст и комментарии »

  • Проголосовать: нравится
  • 0
  • Проголосовать: не нравится

Автор jaigurudev, 9 лет назад, По-английски

Can I find any question to practice that require the application of euler totient theorem

Thanks in advance

Полный текст и комментарии »

  • Проголосовать: нравится
  • +1
  • Проголосовать: не нравится

Автор jaigurudev, 10 лет назад, По-английски

Method 1 : for all n belonging to [l,u]{ if(n==2 || n==3) then n is prime and continue for all odd i belonging from 3 to sqrt(n) if i is a factor of n => n is not prime else n is prime }

Method 2: seive of eratosthenes Consider an array a = {2,3,4,...,u} do until array 'a' is non empty{ let x be the first element of 'a' in ascending order remove x and all its multiples from 'a' if x>=l => x is a prime in [l,u]
}

For Any other good methods .. please comment

Полный текст и комментарии »

  • Проголосовать: нравится
  • -1
  • Проголосовать: не нравится

Автор jaigurudev, 10 лет назад, По-английски

Can any help with an algo that is fast enough to calculate the gcd of two positive numbers. I think one good approach will be to use __gcd of C++ but it is inbuilt, i want to create my own function. Please help...

Полный текст и комментарии »

  • Проголосовать: нравится
  • -16
  • Проголосовать: не нравится

Автор jaigurudev, 10 лет назад, По-английски

I am beginner to coding and i found a very useful site on this topic

http://www.jahya.net/blog/?2013-05-git-vs-github .. Hope u guys like it

Полный текст и комментарии »

  • Проголосовать: нравится
  • -15
  • Проголосовать: не нравится