[algogeeks] Re: convert binary matrix to zero matrix

2010-12-25 Thread Ankur
when you are talking abt starting from 1 that means that array is 1 based , right ? and how did you get the steps calculated. please can you explain, once more take this example, a trivial but albeit will help me explain. 111 000 000 and 011 100 100 if it is feasible for you to reply . On Dec

[algogeeks] SQL Interview quetions ????

2010-12-25 Thread coolfrog$
can some body provide Sql interview Question, for bigger companies like Microsoft , SAP..etc.. Like here on Algogeeks we find all range of Algorithms question... Pls suggest some links for tricky question in SQL.. and Unix(basics).. thankyou in advance... -- *Divesh* (¨`·.·´¨) Always

Re: [algogeeks] Re: convert binary matrix to zero matrix

2010-12-25 Thread Ankur Khurana
i have devised another apporah for same but i would have liked to understand what terence has said ? On Sat, Dec 25, 2010 at 3:01 PM, Ankur ankur.kkhur...@gmail.com wrote: when you are talking abt starting from 1 that means that array is 1 based , right ? and how did you get the steps

[algogeeks] Don't Sort

2010-12-25 Thread punnu
There are N students in a class. They got marks in a certain test. Teacher decides to give prize1 to top log(n) students and the next sqrt(n) students be given prize2. However, he has stipulated that we cannot sort the student roll list according to marks (which would take O(nlog(n)) time) but

Re: [algogeeks] Re: SUN Microsystem Question

2010-12-25 Thread Satya
@Dave, I think you meant* *MIN** Heap here? On Fri, Dec 24, 2010 at 6:46 PM, Dave dave_and_da...@juno.com wrote: @Bittu: Using the first 10 numbers, build a max heap. Then add each number into the 11th array position (always the 11th position) and perform the up-heap operation. At the end

Re: [algogeeks] Don't Sort

2010-12-25 Thread mohit ranjan
how about bucket sort ? with may be bucket size=100 //if max marks=100 Mohit On Sat, Dec 25, 2010 at 6:59 PM, punnu punnu.gino...@gmail.com wrote: There are N students in a class. They got marks in a certain test. Teacher decides to give prize1 to top log(n) students and the next sqrt(n)

Re: [algogeeks] Re: SUN Microsystem Question

2010-12-25 Thread Satya
@Dave, you are right. MAX Heap is correct for your always 11th position removal logic. . Satya On Fri, Dec 24, 2010 at 9:45 PM, Satya satya...@gmail.com wrote: @Dave, I think you meant* *MIN** Heap here? On Fri, Dec 24, 2010 at 6:46 PM, Dave dave_and_da...@juno.com wrote:

[algogeeks] Re: Don't Sort

2010-12-25 Thread juver++
You may use bucket sort if extra space is enough. Second approach - find (log n)-th statistic and then (log n + sqrt n). After doing so you may output all students that have marks below corresponding bounds. There is O(n) algorithm for finding such values. -- You received this message because

[algogeeks] Re: Find all the subset of an array whose sum is equal to some number

2010-12-25 Thread juver++
What you need to get for the answer - amount of such subsets or display them? First problem can be solved using DP. Second - brute force. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to

[algogeeks] help me solve this problem

2010-12-25 Thread sudhir mishra
**https://www.spoj.pl/problems/MCARDS/en/ -- -- regards *Sudhir Mishra* 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 unsubscribe from this group, send

Re: [algogeeks] Re: Don't Sort

2010-12-25 Thread Puneet Ginoria
I can use bucket sort.But sorting is strictly prohibited. The question gives a hint which says use your data structure theory to figure this one out. On Sat, Dec 25, 2010 at 9:16 PM, juver++ avpostni...@gmail.com wrote: You may use bucket sort if extra space is enough. Second approach - find

Re: [algogeeks] Re: Find all the subset of an array whose sum is equal to some number

2010-12-25 Thread Puneet Ginoria
This attachment contains the code for the above program in SML language and it uses lambda calculus. On Sat, Dec 25, 2010 at 9:18 PM, juver++ avpostni...@gmail.com wrote: What you need to get for the answer - amount of such subsets or display them? First problem can be solved using DP.

[algogeeks] Chess Programming

2010-12-25 Thread punnu
Guys, please provide me some links where i can see chess designing algorithms. I am not worried about GUI. Thnxxx in advance -- 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

Re: [algogeeks] Re: Find all the subset of an array whose sum is equal to some number

2010-12-25 Thread Puneet Ginoria
sorry i forgot to attach here it is On Sat, Dec 25, 2010 at 10:34 PM, Puneet Ginoria punnu.gino...@gmail.comwrote: This attachment contains the code for the above program in SML language and it uses lambda calculus. On Sat, Dec 25, 2010 at 9:18 PM, juver++ avpostni...@gmail.com wrote:

Re: [algogeeks] Find a specific number in a special matrix.

2010-12-25 Thread monty 1987
Suppose you have a matrix n*m. each column and row of the matrix is already sorted. For example: 1,2,3 2,3,4 4,5,6 *In how much time we can sort the elements of this matrix ? As far as i m getting idea that if we have n*n elements then we can sort it in n^3 time*. It can be done

Re: [algogeeks] Find a specific number in a special matrix.

2010-12-25 Thread yq Zhang
But if we sort n*n elements directly using quick sort, the expected sorting time is only n*n*log(n*n) n^3. On Sat, Dec 25, 2010 at 9:19 AM, monty 1987 1986mo...@gmail.com wrote: Suppose you have a matrix n*m. each column and row of the matrix is already sorted. For example: 1,2,3 2,3,4

[algogeeks] Re: Simulation algo

2010-12-25 Thread Glauben
Hello , any one have a documentation or code source related to simulation send to me , please . All the best . On 25 déc, 19:12, Glauben glauben...@gmail.com wrote: Hello , Thank you very much Chi and pschaus for your answers , i know that The Ant-Colony-Optimization is related to computer

Re: [algogeeks] Re: Interview question

2010-12-25 Thread yq Zhang
How to solve the second question? it is different from the other question posted where it requres only SQUARE sub matrix. Sent from Nexus one On Dec 25, 2010 11:00 AM, juver++ avpostni...@gmail.com wrote: Try to search the answer before sumbitting the question here. -- You received this

Re: [algogeeks] Re: 1s and 0s

2010-12-25 Thread Praveen Baskar
Your Second approach is cool :) On Wed, Dec 22, 2010 at 1:06 PM, juver++ avpostni...@gmail.com wrote: Use bits manipulation tricks. 1. There is a way to remove a group of consecutive 1's from the right: A = n (n + 1). Then check if A==0 then OK. 2. Second approach: B=n+1, check if B (B-1)