But remember that if you are using CPP then its better to allocate
sufficient memory to
str1 , since you are copying str into str1. if str is very big string it
might give a core dump since the possiblity of illegal memory access arises.
On Thu, Nov 15, 2012 at 3:33 PM, shivendra singh
@all I Went Through Similar Question Some Times back,i hope piyesh used the
same idea, have a look @ Naive efficient Algorithm for doing the same.
http://shashank7s.blogspot.com/2011/06/wap-to-output-all-intervals-i-j-where.html
*
**Regards
Shashank Mani Computer Science Is Awesome So Why I
Nice one..
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To view this discussion on the web visit
https://groups.google.com/d/msg/algogeeks/-/ShfCI3o9YY0J.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from
Given a string which oly has 0's and 1's . Find the maximum largest
substring which have equal no of 0's and 1's and give the length of the
substring .
whether it can be solved in DP ?? or any other soln ?
for example :
given string : 001101000
output :0101
--
You received this message
- Keep an counter for first stuck number(0/1)
- increment it, if you stuck on other number, start decrementing it
- if the counter becomes zero,note that seq
- finally take the longest seq
Hope this could solve the problem.
On Sat, Aug 13, 2011 at 1:56 PM, vicky S
@raghavan: can u explain wid an example plz
On Sat, Aug 13, 2011 at 4:11 PM, Raghavan its...@gmail.com wrote:
- Keep an counter for first stuck number(0/1)
- increment it, if you stuck on other number, start decrementing it
- if the counter becomes zero,note that seq
- finally
Me too didn't get Raghavan's algo... Pls explain..
It seems that above algo will find only longest sequence starting from index
0.
Just a thought:
Along with raghavan's algo, what if I keep and
array_of_integers[string_length]
and keep on storing the count in this array.
Once string is
Here is my algo:
1)Replace all '0' with '1' and '1' with '-1'(.i.e, 1 0 1 --- -1 1 -1)
2)Now take an array to calculate the sum of all elements from 1 to that
index, which can be calculated as sum[i]=sum[i-1]+ar[i],take 0th element as
0.
3)Now the problem becomes finding two indices (say i,j)
suppose if i give
Ssmall:es
Sbig:he's a algogeek and he's rocking
wat will be o/p?
On Sun, May 16, 2010 at 8:12 PM, divya sweetdivya@gmail.com wrote:
You r given a large string of characters lets call it Sbig. Then there
is a small set of characters lets call it Ssmall. You have to find
output ll be : e's
On 16 May 2010 20:17, sharad kumar aryansmit3...@gmail.com wrote:
suppose if i give
Ssmall:es
Sbig:he's a algogeek and he's rocking
wat will be o/p?
On Sun, May 16, 2010 at 8:12 PM, divya sweetdivya@gmail.com wrote:
You r given a large string of characters
use dp to solve this.
On Sun, May 16, 2010 at 8:17 PM, sharad kumar aryansmit3...@gmail.comwrote:
suppose if i give
Ssmall:es
Sbig:he's a algogeek and he's rocking
wat will be o/p?
On Sun, May 16, 2010 at 8:12 PM, divya sweetdivya@gmail.com wrote:
You r given a large string of
@navin naidu
like LCS in CLRS???
On Sun, May 16, 2010 at 8:20 PM, divya jain sweetdivya@gmail.comwrote:
output ll be : e's
On 16 May 2010 20:17, sharad kumar aryansmit3...@gmail.com wrote:
suppose if i give
Ssmall:es
Sbig:he's a algogeek and he's rocking
wat will be o/p?
On
@Navin: and that works ! :)
@all : i am sure no heuristic/greedy strategy can be applied.
@divya : did you check your array partitioning algorithm with my example !
--
Rohit Saraf
Second Year Undergraduate,
Dept. of Computer Science and Engineering
@Sharad: yup
On Sun, May 16, 2010 at 8:36 PM, Rohit Saraf rohit.kumar.sa...@gmail.comwrote:
@Navin: and that works ! :)
@all : i am sure no heuristic/greedy strategy can be applied.
@divya : did you check your array partitioning algorithm with my example !
14 matches
Mail list logo