[algogeeks] Re: program for evaluation of remainders

2010-12-10 Thread haxxpop
@Dave Because he wants to optimize it if we can get the boundary of running time, we'll get the faster algorithm haxxpop -- 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 uns

Re: [algogeeks] Re: Microsoft interview question

2010-12-10 Thread ADITYA KUMAR
@ligerdave agree with u :) > -- Regards Aditya Kumar B-tech 3rd year Computer Science & Engg. MNNIT, Allahabad. -- 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 unsubscri

[algogeeks] Re: Row Major Array to Column Major Array

2010-12-10 Thread Dave
See http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.101.1017&rep=rep1&type=pdf. Dave On Dec 10, 8:43 am, Prims wrote: > Write program for converting the row major matrix stored in array to > column major matrix > > for example, if the matrix is > > 1 2 3 > 4 5 6 > > then it is stored i

Re: [algogeeks] Re: Largest rectangle in a binary matrix

2010-12-10 Thread juver++
You may check the following page: http://e-maxx.ru/algo/maximum_zero_submatrix. It is in Russian, however it contains code in C++. Also you may try to translate it in English. -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this gr

[algogeeks] Re: Row Major Array to Column Major Array

2010-12-10 Thread juver++
This is a very simple problem. Are you asking for the code or approach? I don't think it is ok for complete possible hw task for you from scratch. -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algoge...@

[algogeeks] Row Major Array to Column Major Array

2010-12-10 Thread Prims
Write program for converting the row major matrix stored in array to column major matrix for example, if the matrix is 1 2 3 4 5 6 then it is stored in array A = {1,2,3,4,5,6} I need to convert this Array into Column major matrix which is A = {1,4,2,5,3,6} -- You received this message because

[algogeeks] Re: program for evaluation of remainders

2010-12-10 Thread Dave
@Ankit: Why not just use the algorithm I proposed in http://groups.google.com/group/algogeeks/msg/2941ab071a39517c: x = 0; for( i = (n < N ? n : N) ; i > 0 ; --i ) x = (i * x + i) % n; Dave On Dec 10, 4:23 am, ankit sablok wrote: > @Dave > we will use residues then i think the property of m

[algogeeks] Re: Microsoft interview question

2010-12-10 Thread ligerdave
@aditya there is always trade-off. for what it's asking, TRIE is probably the fastest. the problem already stated, using "data structure", which to me, means, you index a document. indexing is expensive, but it's overhead process and it has nothing to do w/ finding an existing word in a doc. On De

Re: [algogeeks] Microsoft interview question

2010-12-10 Thread ankit sablok
then u can just use or build a dynamic dictionary of words as done in LZW coding such that if the word is there in the dictionary it just gives u the indx of the word and if its not it just adds that word to the dictionary any suggestions are always welcomed thnx in advance On Fri, Dec 10, 2010 at

[algogeeks] just confirming my answer

2010-12-10 Thread ankit sablok
Q) an n-input m-output boolean function is defined as follows (F:{True,False}^n->{True,False} ^m) find the number of n X 1 functions meaning n inputs and 1 output and n X m funcrtions meaning n inputs and m outputs my answer at any time we can reduce the

Re: [algogeeks] Microsoft interview question

2010-12-10 Thread manoj lalavat
it will give you an idea. http://en.wikipedia.org/wiki/Full_text_search On Fri, Dec 10, 2010 at 4:03 PM, ADITYA KUMAR wrote: > @ankit > u can'nt use TRIE > becoz , input will be given in form of text > so generating the TRIE will be much expensive than linear search > > On Fri, Dec 10, 2010 at

Re: [algogeeks] Microsoft interview question

2010-12-10 Thread ADITYA KUMAR
@ankit u can'nt use TRIE becoz , input will be given in form of text so generating the TRIE will be much expensive than linear search On Fri, Dec 10, 2010 at 3:13 PM, GOBIND KUMAR wrote: > Help me in solving this problem... Define a data struct for the search > engine which will represent

[algogeeks] Re: program for evaluation of remainders

2010-12-10 Thread ankit sablok
@Dave we will use residues then i think the property of modulus 1!mod997 + 2!mod997 + 3!mod997 .. + 997!mod997 i just proposed the solution using congruences for the case n wrote: > @Ankit: So how does that work with, e.g., N = n = 997? I.e., what is > the calculation? > > Dave > > On Dec 8,

Re: [algogeeks] Microsoft interview question

2010-12-10 Thread ankit sablok
just search for the word in the document using an efficient string matching algorithm use Knuth Morris Pratt algorithm as it runs in O(m) time. or use a data structure called TRIE where u can search for the word in O(1) time any suggestions are always welcomed On Fri, Dec 10, 2010 at 3:13 PM, GOB

[algogeeks] Microsoft interview question

2010-12-10 Thread GOBIND KUMAR
Help me in solving this problem... Define a data struct for the search engine which will represent whether given word is there in the document or not .It should be fast. -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this

Re: [algogeeks] Re: Valid Array

2010-12-10 Thread fenghuang
@mohan, when the num of repeatation is bigger than 1, it may be wrong,please check {1, 1, 2, 5, 6, 6} On Fri, Dec 10, 2010 at 12:41 PM, mo...@ismu wrote: > i did nt get this xor part in adithya solution > > check if this works > > array is valid if satisfy 2 conditions > 1.max-min=n-1 > 2.there