Will Rope Data Structure work on the problem String Query in April '13??
And is there any good tutorial on it??
Will Rope Data Structure work on the problem String Query in April '13??
And is there any good tutorial on it??
What is rope data structure?
ya that one…
This was exactly what i thought, but unfortunately i could not implement it or get any tutorial on it. There is a sgi library for it but how to implement it on my own still remains a mystery for me.
Ya… I searched a lot… The best description I could find was on wikipedia…
when i searched for strquery i got something called “Generalized suffix tree” which can support all given operations in specified limits.But i didn’t get some working code of it.Seems like same thing
is implemented in @winger’s solution.
Dynamic Extended Suffix Arrays should do the job too.
Unfortunately I didn’t have time to implement it properly.
@cyberax: The thesis is really helpful… Will certainly implement it sometime…
But still it would be really helpful if in addition to above algorithm, I could get some help with Rope Data Structure…
what kinda help do you need ? as far as I understand the wiki page, it’s a specific kind of binary tree. you could find possible implementations in common languages in the external links section.
as i told you, external links in the wiki page :
http://gcc.gnu.org/onlinedocs/libstdc++/libstdc+±html-USERS-4.3/a01984.html
Thats like huge… but anyways thanx…
yeah, i thought the same. you could probably start from scratch, simply designing a binary tree, and then add method by method the features of ropes. i mean, if i were you, i would probably do that, because i understand better when i implement myself. good luck
yeah,i got the same paper initially(when i was trying with suffix arrays) but never get any working code for “Dynamic Extended Suffix Arrays” or “Generalized suffix tree”.Can you provide me some???
Oh, It has a paper? Actually I made this problem myself.
And also I failed to prevent O(n^1.5) solution from getting Accpected, maybe It could be Online query or even past-time query.
I have to admit codechef guys are putting some very good and tough real life problems these days like this one which could pave way for an efficient algos in text editors .
i used double link list to solve this problem. but it constantly showed run time error TLE WA … don’t know whats exact problem. as the problem had 150000 alphabets so i too had to dynamically allocate memory… i think cause of this much of memory ,it was showing random errors … if u guys have any idea then please tell me.
How about using a Doubly Linked List for this problem.
I had tried this logic in Java but was getting a Runtime error. Please share your thoughts if it is a reasonable approach.