Re: Re: Fwd: [algogeeks] Re: Largest substring with unique characters

2011-07-22 Thread vaibhavmittal11
Thanx for pointitn out the case :) Hope dis wil wrk. https://ideone.com/0LNkW On , Pankaj wrote: aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwzzyyzzabc output: Length of largest unique substring : 51 Sorry it gt posted thrice. On Jul 22, 7:50 pm, vaibhavmitta...@gmail.com wrote

Re: Fwd: [algogeeks] Re: Largest substring with unique characters

2011-07-22 Thread Pankaj
aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwzzyyzzabc output: Length of largest unique substring : 51 Sorry it gt posted thrice. > > On Jul 22, 7:50 pm, vaibhavmitta...@gmail.com wrote: > > https://ideone.com/kzo2L > > > > Regards > > Vaibhav Mittal > > Computer Science > > Netaji Subhas Inst

Re: Fwd: [algogeeks] Re: Largest substring with unique characters

2011-07-22 Thread svm11
Sorry it gt posted thrice. On Jul 22, 7:50 pm, vaibhavmitta...@gmail.com wrote: > https://ideone.com/kzo2L > > Regards > Vaibhav Mittal > Computer Science > Netaji Subhas Institute Of Technology > Delhi. > > On , Pankaj wrote: > > > > > > > > > Vaibhav, Ok write your code and paste on ideone. It

Re: Re: Re: Fwd: [algogeeks] Re: Largest substring with unique characters

2011-07-22 Thread vaibhavmittal11
https://ideone.com/kzo2L Regards Vaibhav Mittal Computer Science Netaji Subhas Institute Of Technology Delhi. On , Pankaj wrote: Vaibhav, Ok write your code and paste on ideone. It should be easy and quick to code :) On Fri, Jul 22, 2011 at 7:59 PM, vaibhavmitta...@gmail.com> wrote: U

Re: Re: Re: Fwd: [algogeeks] Re: Largest substring with unique characters

2011-07-22 Thread vaibhavmittal11
https://ideone.com/kzo2L Regards Vaibhav Mittal Computer Science Netaji Subhas Institute Of Technology Delhi. On , Pankaj wrote: Vaibhav, Ok write your code and paste on ideone. It should be easy and quick to code :) On Fri, Jul 22, 2011 at 7:59 PM, vaibhavmitta...@gmail.com> wrote: U

Re: Re: Re: Fwd: [algogeeks] Re: Largest substring with unique characters

2011-07-22 Thread vaibhavmittal11
https://ideone.com/kzo2L Regards Vaibhav Mittal Computer Science Netaji Subhas Institute Of Technology Delhi. On , Pankaj wrote: Vaibhav, Ok write your code and paste on ideone. It should be easy and quick to code :) On Fri, Jul 22, 2011 at 7:59 PM, vaibhavmitta...@gmail.com> wrote: U

Re: Re: Fwd: [algogeeks] Re: Largest substring with unique characters

2011-07-22 Thread Pankaj
Vaibhav, Ok write your code and paste on ideone. It should be easy and quick to code :) On Fri, Jul 22, 2011 at 7:59 PM, wrote: > U hv got my algo completely wrong. Gimme a smaller test case so that i may > wrk it out fr u. This one is freakingly large :P. > > > Regards > Vaibhav Mittal > Compu

Re: Fwd: [algogeeks] Re: Largest substring with unique characters

2011-07-22 Thread Pankaj
*abcdea*ifjlbmnodpq For this once you encounter a at 6th position, You can update your max. Now You will have to do following operation. First clear all the hash. 2. You now can not start from 6th position. You will have to do back and start from 2 position that is b. Right? What is the maximum un

Re: Re: Fwd: [algogeeks] Re: Largest substring with unique characters

2011-07-22 Thread vaibhavmittal11
U hv got my algo completely wrong. Gimme a smaller test case so that i may wrk it out fr u. This one is freakingly large :P. Regards Vaibhav Mittal Computer Science Netaji Subhas Institute Of Technology Delhi. On , Pankaj wrote: abcdeaifjlbmnodpq For this once you encounter a at 6th position

Re: Fwd: [algogeeks] Re: Largest substring with unique characters

2011-07-22 Thread vaibhavmittal11
Have a look again. I traverse the string just once performing updation on variables low, high, max. I assume array operations to be O(1) (which they are). OVerall complexity is O(n).Once I hit a duplicate i change my low, high and A accordingly and move forward. Regards Vaibhav Mittal Compu

Fwd: [algogeeks] Re: Largest substring with unique characters

2011-07-22 Thread Pankaj
Vaibhav What do you think the complexity of your algo is. And once you hit an duplicate, from where will you start again? Try for this example abcdeaifjlbmnodpq. It will be still O(26*n) as at max, we would have to start from each letter and go forward maximum 26times( if we reach 26 then we have i