[algogeeks] Re: longest common subsequence problem

2006-01-24 Thread ricky
you can store the two strings in an upside down suffix tree. a simple edge scan of common path will give you all possible (and largest) common substring

[algogeeks] Re: Given an array containing both positive and negative integers, we r required to find the sub-array with the largest sum

2006-01-24 Thread ricky
Think of the negative numbers as consumers from a warehouse and positive numbers as producers from the warehouse. The problem reduces to plotting the inventory (starting from time = 0 to time = n) and then finding the max amplitude over time axis in +ve quadrant of the inventory profile which can

[algogeeks] Re: longest common subsequence problem

2006-01-24 Thread Gene
In perl (hopefully the homework has been due already)... use strict; our %memo; sub lcs { my ($x, $y) = @_; my $key = $x|$y; return $memo{$key} if defined $memo{$key}; my $s = ''; for (my $i = 0; $i length($x); $i++) { for (my $j = 0; $j length($y); $j++) { if

[algogeeks] Re: Newcomer to neural networks

2006-01-24 Thread rohit
Thanks a lot Jeff and Mattia I'll get back as soon as I have studied some Rohit