[algogeeks] Re: Amazon question

2012-03-22 Thread Anurag Gupta
I think this works and the complexity is O(sqrt(n)) #includecmath #includecstdio #includeiostream #includecstring #includecstdlib using namespace std; # define INFY 17 int main() { int n, i, j; int val, minDiv, minDis; while(1) { cin n; minDis =

Re: [algogeeks] Re: Check if one tree is sub tree of other

2012-03-22 Thread siddharam suresh
thank you for telling the unworkability of my algo. i did not see the puzzle completely. my algo works only for BST. Thank you, Sid. phone:+91-8971070727, +91-9916809982 On Wed, Mar 21, 2012 at 8:49 PM, Lucifer sourabhd2...@gmail.com wrote: @All [ Let the tree to be searched in be 'T' and

Re: [algogeeks] Re: Amazon question

2012-03-22 Thread Amol Sharma
+1 @ anurag's solution.agree with O(sqrt(n)) complexity. -- Amol Sharma Third Year Student Computer Science and Engineering MNNIT Allahabad http://gplus.to/amolsharma99 http://twitter.com/amolsharma99http://in.linkedin.com/pub/amol-sharma/21/79b/507http://www.simplyamol.blogspot.com/

[algogeeks] MySql Connector/C

2012-03-22 Thread Gobind Kumar Hembram
Hi Do any one know how to configure MySQL Connector ; so as to connect to MySql using C.If any one have any idea ; please share. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com.

[algogeeks] Re: MySql Connector/C

2012-03-22 Thread Gene
My friend, all you have to do is read the manual. http://dev.mysql.com/doc/refman/5.6/en/c.html On Mar 22, 1:14 pm, Gobind Kumar Hembram gobind@gmail.com wrote: Hi Do any one know how to configure MySQL Connector ; so as to connect to MySql using C.If any one have any idea ; please

[algogeeks] Re: Check if one tree is sub tree of other

2012-03-22 Thread Gene
I'll point out that if you are building a system where this problem actually occurs (as in generating DAGs in a compiler expression optimizer), you can nearly always engineer the problem down to O(log(| T|)) if T is balanced and O(|T|) in the worst case. Trees need parent pointers, and also a map

Re: [algogeeks] Amazon question

2012-03-22 Thread Rujin Cao
@atul: Anurag's code has illustrated the idea of O(sqrt(E)) solution. One more thing to optimize is that we can safely break after finding the first factor of E which is less than sqrt(E). So the code could be changed to:

Re: [algogeeks] Amazon question

2012-03-22 Thread Amol Sharma
but the worst case still remains O(sqrt(E)) -- Amol Sharma Third Year Student Computer Science and Engineering MNNIT Allahabad http://gplus.to/amolsharma99 http://twitter.com/amolsharma99http://in.linkedin.com/pub/amol-sharma/21/79b/507http://www.simplyamol.blogspot.com/ On Fri, Mar 23,

[algogeeks] GSOC help android app inventor

2012-03-22 Thread Raghav Garg
*Hello, I am very much interested in android development and also i have made few apps with eclipse and also with app inventor. I need to know what else i can do to contribute in app inventor to get selected in GSOC besides from just filling the application. *Thanking you *With regards- Raghav

[algogeeks] networking

2012-03-22 Thread Aman Kumar
Hii to all how to make a call of class's method(function) from client side to server in java? please replyit's urgent -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To

Re: [algogeeks] networking

2012-03-22 Thread amrit harry
using ajax..hit google for ajax... On Fri, Mar 23, 2012 at 10:07 AM, Aman Kumar amanas...@gmail.com wrote: Hii to all how to make a call of class's method(function) from client side to server in java? please replyit's urgent -- You received this message because you are subscribed to

Re: [algogeeks] networking

2012-03-22 Thread atul anand
there would be better way of doing so, but one of the simplest way to do so is by serializing the object whose method you need to call, inside object you need to have one more attribute say int code. each code are distinct for each methods in that class.Now when server receive this object and

Re: [algogeeks] networking

2012-03-22 Thread Rishabbh A Dua
if u have a web application then ajax is good else for desktop type applications u can also look into remote procedure calls in java. /Rishabbh On Fri, Mar 23, 2012 at 10:24 AM, atul anand atul.87fri...@gmail.comwrote: there would be better way of doing so, but one of the simplest way to do