Re: [algogeeks] making a graphical c++ programme

2011-02-26 Thread Ankur Khurana
What is your primary purpose . If you want to make a game , OpenGL and AllegroGL is way to go .Other wiase to make appliations , you can use visual c++. Can you be more specific ? Regards, Ankur On Sat, Feb 26, 2011 at 1:22 PM, Logic King crazy.logic.k...@gmail.comwrote: I also want to know

[algogeeks] Re: Puzzle For Puzzled Minds -How Many Rounds..???

2011-02-26 Thread Venki
Yeah. Sorry, it is my bad missed to observe N = 5623. Regards, Venki. On Feb 25, 11:22 pm, Dave dave_and_da...@juno.com wrote: @Venki. Hmmm. Let me see. The problem specified that there were 5623 participants. That makes n = 5623. You say that n-1 games are needed, and compute that as 5621.

[algogeeks] Re: 25february

2011-02-26 Thread anuja verma
19(I m d driver and I m 19) On Feb 26, 12:35 pm, Lavesh Rawat lavesh.ra...@gmail.com wrote: *Bus Driver Problem Solution* ok let's say you're driving a bus and it's empty. At the first stop two(2) people get on. At the second stop five(5) people get on and one(1) person exits. At the third

[algogeeks] Call For Papers: Int'l Conf. on Software Engineering Research and Practice (SERP'11), USA, July 18-21, 2011

2011-02-26 Thread A. M. G. Solo
Dear colleagues: Please share the appended announcement with those who may be interested. Thank you - Steering Committee, SERP      CALL  FOR  PAPERS and   Call For Workshop/Session Proposals

Re: [algogeeks] Mathematics Problem

2011-02-26 Thread Gunjan Sharma
As the competition is over I can reveal u the answer. There is only one number satisfying given condition and that is 578 so the answer is 20 :) On Fri, Feb 25, 2011 at 10:33 PM, vaibhav shukla vaibhav200...@gmail.comwrote: nothing to do with complexity... just the ans On Fri, Feb 25, 2011

[algogeeks] Re: Lets C Who Really Loves Perfect Square .................

2011-02-26 Thread bittu
@all hi what do you think about this https://ideone.com/8QAig Please Let Me Know if something wrong with this Thanks Regards Shashank The Best Way to Escape From The Problem is Solve It -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group.

[algogeeks] Array , Number Missing or Duplicate ..

2011-02-26 Thread bittu
Given an array of integers where some numbers repeat 1 time, some numbers repeat 2 times and only one number repeats 3 times, how do you find the number that repeat 3 times. Thanks Shashank -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To

Re: [algogeeks] Array , Number Missing or Duplicate ..

2011-02-26 Thread radha krishnan
XOR :P On Sat, Feb 26, 2011 at 10:11 PM, bittu shashank7andr...@gmail.com wrote: Given an array of integers where some numbers repeat 1 time, some numbers repeat 2 times and only one number repeats 3 times, how do you find the number that repeat 3 times. Thanks Shashank -- You received

Re: [algogeeks] Mathematics Problem

2011-02-26 Thread Mohan Mangal
hi Gunjan, Can you please give the methodhow you achieved this answer... On Sat, Feb 26, 2011 at 9:36 PM, Gunjan Sharma gunjan.khan...@gmail.com wrote: As the competition is over I can reveal u the answer. There is only one number satisfying given condition and that is 578 so the answer

Re: [algogeeks] Mathematics Problem

2011-02-26 Thread Gunjan Sharma
There are only few numbers satisfying the 1st property and for them I checked using python the second condition. :) Competition name - Codematics On Sun, Feb 27, 2011 at 1:18 AM, Rel Guzman Apaza rgap...@gmail.com wrote: what competition? 2011/2/26 Gunjan Sharma gunjan.khan...@gmail.com As

[algogeeks] need help with a classic algorithm

2011-02-26 Thread MarchMadness
You are given n coins, at least one of which is bad. All the good coins weigh the same, and all the bad coins weigh the same. The bad coins are lighter than the good coins. Find the exact number of bad coins by making O(logn)^2 weighings on a balance. Each weighing tells you whether the total

[algogeeks] Re: Lets C Who Really Loves Perfect Square .................

2011-02-26 Thread Dave
Another optimization: Since the sum of the digits of n^2 is 45, n^2 is divisible by 9. Thus, we need consider only n values that are divisible by 3. Thus, the outer for-loop can be written for( n = 31992 ; n 99381 ; n+=3 ) Dave On Feb 23, 7:02 pm, Dave dave_and_da...@juno.com wrote: Try this:

[algogeeks] Re: Array , Number Missing or Duplicate ..

2011-02-26 Thread Dave
@Radha: Please explain your method further. You can use this data: 0, 1, 2, 4, 4, 5, 5, 6, 6, 6. Dave On Feb 26, 10:44 am, radha krishnan radhakrishnance...@gmail.com wrote: XOR :P On Sat, Feb 26, 2011 at 10:11 PM, bittu shashank7andr...@gmail.com wrote: Given an array of integers where

Re: [algogeeks] [brain teaser ] 25february

2011-02-26 Thread Abhijit K Rao
The age guy of bus driver is the age of the puzzle solver. Best Regards Abhijit On Sat, Feb 26, 2011 at 1:05 PM, Lavesh Rawat lavesh.ra...@gmail.comwrote: *Bus Driver Problem Solution* ok let's say you're driving a bus and it's empty. At the first stop two(2) people get on. At the second

Re: [algogeeks] Re: Lets C Who Really Loves Perfect Square .................

2011-02-26 Thread gaurav gupta
@Dave great one. On Sun, Feb 27, 2011 at 3:33 AM, Dave dave_and_da...@juno.com wrote: Another optimization: Since the sum of the digits of n^2 is 45, n^2 is divisible by 9. Thus, we need consider only n values that are divisible by 3. Thus, the outer for-loop can be written for( n = 31992 ;

[algogeeks] Re: 25february

2011-02-26 Thread sankalp srivastava
19 (I'm driving ) Ironically I read this puzzle in chacha chaudhary comics :P On Feb 26, 8:31 pm, anuja verma kcrazy...@gmail.com wrote: 19(I m d driver and I m 19) On Feb 26, 12:35 pm, Lavesh Rawat lavesh.ra...@gmail.com wrote: *Bus Driver Problem Solution* ok let's say you're driving a

Re: [algogeeks] Lets C Who Really Loves Perfect Square .................

2011-02-26 Thread saltycookie
Why not try all possibilities? Not many numbers to enumerate. 2011/2/23 bittu shashank7andr...@gmail.com How to find a number of 10 digits (non repeated digits) which is a perfect square? perfect square examples: 9 (3x3) 16 (4x4) 25(5x) etc. Ten digit number example 1,234,567,890 Thanks

Re: [algogeeks] Re: Amazon Online Test

2011-02-26 Thread Pranjal Saxena
Here is the algo : while(read string in reverse) { if(str = L) create node and push to stack continue if(str = N) pop 2 nodes from stack and asign them as children of N and push N on stack //Here we can get //multiple trees } pop root from stack On Thu,

[algogeeks] Re: Antipodal points

2011-02-26 Thread sankalp srivastava
The points must satisfy the equation (x-x1)(x-x2)+(y-y1)(y-y2)=0 Circle centered at origin x2+y2=Some radius .With N points on the circle , we find out the radius In order to find if the two points are antipodal , we check the first equation putting the two points and checking for any other

[algogeeks] An interesting question

2011-02-26 Thread gaurav gupta
A NxN binary matrix is given. If a row contains a 0 all element in the row will be set to 0 and if a column contains a 0 all element of the column will be set to 0. You have to do it in O(1) space. example : input array : 1 0 1 1 0 0 1 1 1 0 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 result array : 0 0 0

Re: [algogeeks] Pairwise Sum Array

2011-02-26 Thread Ashim Kapoor
I think the output is wrong. It should be 1 3 4 9 n in no call them ai's a[1] to a[n] 4 5 10 7 12 13 m in no call them bi's b[1] to b[m] I assume starting from 1 to make manipulation easier n(n-1)/2= m n(n-1)=2m n2 -n -2m=0 using quadratic formula:- n=1 + sqrt( 1+8m)/2 This will always be a

Re: [algogeeks] Re: Array , Number Missing or Duplicate ..

2011-02-26 Thread gaurav gupta
Kind of brute force with O(n*log(n)) map mint, int; for( int i=0; iN; i++) m[a[i]]++; for each element in hashmap if( m[i] == 3) print i; On Sun, Feb 27, 2011 at 3:59 AM, Dave dave_and_da...@juno.com wrote: @Radha: Please explain your method further. You can use this data:

Re: [algogeeks] Re: String of Max Length Which Repeats More Then Onep

2011-02-26 Thread Terence
@Dave: I think it is to find the longest substring which appears more than once in the given string. @bittu: You could use suffix tree: http://en.wikipedia.org/wiki/Suffix_tree, and find the deepest branch node. or use suffix array: http://en.wikipedia.org/wiki/Suffix_array, and find the

Re: [algogeeks] Parallel algorithms

2011-02-26 Thread Varun Nagpal
Practical - Good mix of theory and practice 1. The Art of Multiprocessor Programming by Maurice Herlihy Nir Shavit 2. Introduction to Parallel Computing, Second Edition. By Ananth Grama, Anshul Gupta, George Karypis, Vipin Kumar 3. Herb Sutter's Blog on Concurrency API Specific 4. Oreilly's

Re: [algogeeks] Pairwise Sum Array

2011-02-26 Thread Ashim Kapoor
That is exactly what my solution is doing. On Thu, Feb 24, 2011 at 5:09 PM, ashish agarwal ashish.cooldude...@gmail.com wrote: There must be another good solution..please let me know . Thanks On Thu, Feb 24, 2011 at 5:09 PM, ashish agarwal ashish.cooldude...@gmail.com wrote: I think..

Re: [algogeeks] Re: amazon

2011-02-26 Thread gaurav gupta
I guess macro can be a work arround for this. in configuration you can provide files which can access a global variable ProtectedVariable you have defined PROTECTEDVARIABLE_ACCESSIBLE_IN_FILEONE like *global.c * int ProtectedVariable = 10; /* other stuff */ *fileone.c * #ifdef

[algogeeks] Re: Lets C Who Really Loves Perfect Square .................

2011-02-26 Thread Dave
@Sankalp: There are 10^10 - 10^9 10-digit numbers. We investigate only about the sqrt of that many to find out how many both are perfect squares and have non-repeating digits. Dave On Feb 26, 11:31 pm, sankalp srivastava richi.sankalp1...@gmail.com wrote: @dave But you are going over elements

[algogeeks] Re: An interesting question

2011-02-26 Thread Rajnish
1.) Traverse the whole matrix and replace each 0 value with -1. 2.) Traverse the matrix again,all the 1 values are replaced with 0 in the row and column of the index where a -1 value is found. 3.) Set all -1 values to zero and we have the output array. time complexity: O(n^2) space complexity:

Re: [algogeeks] Re: Antipodal points

2011-02-26 Thread Kunal Patil
Okk...I got my mistake... Thank you all for clearing my doubts.. On Sun, Feb 27, 2011 at 10:53 AM, sankalp srivastava richi.sankalp1...@gmail.com wrote: The points must satisfy the equation (x-x1)(x-x2)+(y-y1)(y-y2)=0 Circle centered at origin x2+y2=Some radius .With N points on the