Re: [algogeeks] Need good hashing implementations in Linux (C/C++)

2010-07-07 Thread Karthik Reddy
how about google sparsemap and densemap ; they are good with larger set of data . used it with iris and imdb dataset for clustering. On Tue, Jul 6, 2010 at 4:46 PM, Jitendra Kushwaha jitendra.th...@gmail.comwrote: What about STL map I have used it. but for small data.. It is a standard one

Re: [algogeeks] microsoft.

2010-07-07 Thread umesh kewat
use array element as index in linear traversal and der index pointing value as negative when u wll get pointing value negative mean that array index position is 1st repeated element. On Wed, Jul 7, 2010 at 10:18 AM, Anil C R cr.a...@gmail.com wrote: do you need an algorithm which is O(1) in

Re: [algogeeks] ipc

2010-07-07 Thread sharad kumar
@harit why pipes are fastest...plzz explain a bit -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algoge...@googlegroups.com. To unsubscribe from this group, send email to

[algogeeks] Re: microsoft.

2010-07-07 Thread Gaurav Singh
I think you can use counting array in this algo. And keep checking whenever the count of any element goes ahead of 1, it will be the first repeating element. Is it something more difficult than this ?? Please correct me if anything is wrong in my thought. -- You received this message because you

Re: [algogeeks] Longest palindrome in a given str (less than O(n^2) )

2010-07-07 Thread Amit Jaspal
I don't understand how to constuct the suffix tree in less than O(n^2) can anyone explain me this? On Tue, Jul 6, 2010 at 10:03 AM, Jitendra Kushwaha jitendra.th...@gmail.com wrote: @Ankit Narang Think about your algo it is not a O(n). First of all you wont get solution comparing start of

Re: [algogeeks] Re: cycle in Linked List generalised

2010-07-07 Thread harit agarwal
m!=n -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algoge...@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at

Re: [algogeeks] microsoft.

2010-07-07 Thread umesh kewat
if space complexity is O(1) then hash map will not work.. On Wed, Jul 7, 2010 at 10:54 AM, Ashish Goel ashg...@gmail.com wrote: have a hash map trace through all the elements to store the count now trace through the array again and return the element whose count is found to be 2 as the first

Re: [algogeeks] Re: Need help

2010-07-07 Thread Priyanka Chatterjee
Firstly it is srm 475, the following link has the problem http://www.topcoder.com/stat?c=problem_statementpm=10878rd=14156 @crazysaikat : Sorry for misconstruing you. As this group is public it is better not to post problems of a srm while it is running. Apart from discussing it here, if you need

Re: [algogeeks] Plz help with multidimensional array

2010-07-07 Thread sharad kumar
@ashish cant u make use of char *p[30] for 2 d array On Wed, Jul 7, 2010 at 9:34 AM, Ashish Goel ashg...@gmail.com wrote: char name[][10] is a auto variable on stack, so no pointers here Best Regards Ashish Goel Think positive and find fuel in failure +919985813081 +919966006652

Re: [algogeeks] Re: microsoft.

2010-07-07 Thread umesh kewat
Hi Gaurav, yup solution is quite right but that is the worst casebut if wanna that solution in O(n) time complexity and O(1) space complexity but in ur solution it is O(k) space complexity. On Wed, Jul 7, 2010 at 7:17 AM, Gaurav Singh gogi.no...@gmail.com wrote: I think you can use

Re: [algogeeks] amazon:-

2010-07-07 Thread sharad kumar
this the same hamming distance problem...this can be done thorugh trie.pls check archives this has been discussed before.. On Wed, Jul 7, 2010 at 10:12 AM, Ashish Goel ashg...@gmail.com wrote: use levenstein distance algo http://en.wikipedia.org/wiki/Levenshtein_distance Best

Re: [algogeeks] microsoft.

2010-07-07 Thread sharad kumar
ya i want inplace soln -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algoge...@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options,

Re: [algogeeks] adobe problem---array

2010-07-07 Thread jalaj jaiswal
you have misinterpreted the questn.. 1 simply means 1 occurences we have to do this inplace On Wed, Jul 7, 2010 at 10:37 AM, Ashish Goel ashg...@gmail.com wrote: i thought the same way, but in this case 4 is being repeated twice, but is not nullified it is ctually getting nullified,

Re: [algogeeks] Re: cycle in Linked List generalised

2010-07-07 Thread jaladhi dave
There are more efficient ways of doing this. Refer wiki http://en.wikipedia.org/wiki/Cycle_detection#Brent.27s_algorithm On Wed, Jul 7, 2010 at 9:16 AM, Dave dave_and_da...@juno.com wrote: @Anand. You've described one way to do it, and maybe the most efficient way, but not the only way. Dave

[algogeeks] Re: Approximate String Matching Algorithm

2010-07-07 Thread souravsain
@ashgoel Thanks for the reply. Any web link or book / chapter from which I can read more about the nearest word finding approach using trie you mentioned? Thanks in advance. Sourav On Jul 4, 11:12 am, ashgoel ashg...@gmail.com wrote: bloom filters are used for approx matches, however, if you

Re: [algogeeks] plotter

2010-07-07 Thread jaladhi dave
good problem modeling :) On Tue, Jul 6, 2010 at 10:21 AM, Jitendra Kushwaha jitendra.th...@gmail.com wrote: problem can be converted in a graph question we have nC2 paths in n node (here n represent total points) now do travelling salesman on this graph. And the question is done --

Re: [algogeeks] google

2010-07-07 Thread sharad kumar
@topojoy ur understanding of problem is fully correct -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algoge...@googlegroups.com. To unsubscribe from this group, send email to

[algogeeks] Re: Amazon: sort array

2010-07-07 Thread souravsain
@all Please find my O(n) time and O(1) space implementation for this problem. Summary of approach: let i be start for first sorted part and j be start of next sorted part. move i as long as a[i] is less than a[j] as that means things are sorted. if a[i] a[j], swap them and increment i.

[algogeeks] Re: cycle in Linked List generalised

2010-07-07 Thread souravsain
@Amit You should me able to find waether there is a loop or not in a LL with any value of m and n. But if you have to find where the loop is, then you have to chose m and n such that gcd(m,n)=1, as Dave said. Consier the example below

Re: [algogeeks] ipc

2010-07-07 Thread Satya
I think pipes are fastest as the other end process will be trying to read the from fds always(waiting for the input). semaphores,monitors all these need certain condition to meet so that they get ++/-- , notify. Signal's can be masked!!. . Satya On Wed, Jul 7, 2010 at 8:13 AM, sharad

Re: [algogeeks] adobe problem---array

2010-07-07 Thread Satya
not to complicate the question, if it is sorted, then its simple!! . Satya On Wed, Jul 7, 2010 at 3:05 PM, jalaj jaiswal jalaj.jaiswa...@gmail.comwrote: you have misinterpreted the questn.. 1 simply means 1 occurences we have to do this inplace On Wed, Jul 7, 2010 at 10:37 AM,

Re: [algogeeks] Re: Approximate String Matching Algorithm

2010-07-07 Thread Ashish Goel
the approach came just from the top of my head :) please check suffix trie @ http://www.allisons.org/ll/AlgDS/Tree/Suffix/ if you understand this as well as levensthien distance concept, you would understand how i thought of this solution Best Regards Ashish Goel Think positive and find fuel

[algogeeks] Re: Amazon: sort array

2010-07-07 Thread W Karas
I believe a merge sort requires O(n) space complexity. Is stack spce counted towards space complexity? If not, I imagine you could write a merge sort recursively, so that the explict space usage has O(1) complexity. On Jul 2, 2:37 pm, Abhishek Sharma jkabhishe...@gmail.com wrote: I think its

Re: [algogeeks] Array with 0 and 1

2010-07-07 Thread Ratnesh Thakur
for(i=0 to n-1) if( binarysearch(i,n-1,1) + 1) count++ print count. binarysearch(first,last,item) if(1 is there) return mid else return -1. similarly we can go for coloumns. o(nlogn) On 7/5/10, divya jain sweetdivya@gmail.com wrote: i think u need to visit every element atleast

[algogeeks] Re: microsoft.

2010-07-07 Thread souravsain
@sharad When you say you want first repeating element, do u mean first in the sense in which numbers are layed out in the array (i mean moving from left to right in the array, the first element, =K, that is repeating) or the first smallest element that is repeating? for example in the given