[algogeeks] painting cube 253 -- n dimension

2006-07-11 Thread Nik
Hi, This is regarding the problem 253 (painting cube ) on uva.http://acm.uva.es/p/v2/253.html I have got this problem accepted from the below code. I have removed some variables and other things to make sure this problem doesn't get accepted by copy paste method. here are few questions. I

[algogeeks] Re: Cyclic permutation

2006-07-11 Thread Googmeister
Arun wrote: > searching first copy of S in double-sized string is O(n^2). isnt it? There are a number of linear time string searching algorithm, e.g., Knuth-Morris-Pratt. It's O(n) if you use one of these. > On 7/11/06, Googmeister <[EMAIL PROTECTED]> wrote: > > > > > > > > Terry wrote: > > >

[algogeeks] Re: Cyclic permutation

2006-07-11 Thread Arun
searching first copy of S in double-sized string is O(n^2). isnt it?On 7/11/06, Googmeister <[EMAIL PROTECTED] > wrote:Terry wrote:> Hi,>> Say i have a string abcd > bcda is a cyclic permutation of abcd obtained by rotating the string 1> left.>> Given a string P of length n,> how to determine if st

[algogeeks] Re: Capacitated Vehicle Routing Problem - Algorithm and Relaxation

2006-07-11 Thread wade
markus_swartz wrote: > Hi, > > I´m trying to write some code in order to find a good approximation to > the solution of a Capacitated Vehicle Routing Problem (similar to the > Multiple Traveling Salesman Problem). I am aware that´s an NP-hard > problem. > > Does anybody have an idea of what relax

[algogeeks] Re: Cyclic permutation

2006-07-11 Thread Googmeister
Terry wrote: > Hi, > > Say i have a string abcd > bcda is a cyclic permutation of abcd obtained by rotating the string 1 > left. > > Given a string P of length n, > how to determine if string S of length is cyclic permutation of string > P. Here's a linear time solution: concatenate two copies o

[algogeeks] Cyclic permutation

2006-07-11 Thread Terry
Hi, Say i have a string abcd bcda is a cyclic permutation of abcd obtained by rotating the string 1 left. Given a string P of length n, how to determine if string S of length is cyclic permutation of string P. Second which way should we rotate left or right so that the cyclic permutations are s