sandeepandey's blog

By sandeepandey, 11 years ago, In English

Hello All.

I am trying this problem:http://www.spoj.com/problems/EPALIN/. I have implemented Rabin karp algorithm (Roll Hash).I am getting wrong answer for this problem.

Could you guys tell me some test cases where it may fail. MyCode:http://ideone.com/liVEDu

Full text and comments »

  • Vote: I like it
  • -3
  • Vote: I do not like it

By sandeepandey, 11 years ago, In English

Count smaller elements on right side

input :[4,12,5,6,1,34,3,2] output: [3,5,3,3,0,2,1,0]

I know this can be solved using MergeSort but i want to know how to solve it using segment tree ? What actually we have to store in Node of segment tree.

Full text and comments »

  • Vote: I like it
  • +2
  • Vote: I do not like it