[algogeeks] find a way

2011-01-22 Thread snehal jain
Suppose you want to travel from city A to city B by car, following a fixed route. Your car can travel m miles on a full tank of gas, and you have a map of the n gas stations on the route between A and B that gives the number of miles between each station. Design an algorithm to find a way to get

[algogeeks] young tableaus

2011-01-22 Thread snehal jain
. Given n distinct elements, how many Young tableaus can you make? i think the ans is 1!*2!*3!...sqrt(n)!*...*3!*2!*1! plz correct me if i am wrong.. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to

[algogeeks] Re: Google Question

2011-01-22 Thread rajessge...@yahoo.com
it will give m=15 for n=10,but actually m=16 On Jan 21, 10:58 am, Preetam Purbia preetam.pur...@gmail.com wrote: Hi, I think this method will work: Possible Number of A's = N/2(1+R) where R=N-(N/2+3) assuming 11/2 = 5 Thanks Preetam On Fri, Jan 21, 2011 at 2:29 AM, Anand

[algogeeks] Re: Google Question

2011-01-22 Thread rajessge...@yahoo.com
//get n; if(n%3==0) { v=6; pw=(n-3)/3; } else if(n%3==1) { v=4; pw=(n-1)/3; ] else { v=5; pw=(n-2)/3; } maxtimes=(v)*pow(2,pw); sequence is pressing 'A' v times followed by (select+copy+paste=3 operations) pw times which means 3*pw; total 3*pw+v=n times On Jan 19, 8:28 pm, bittu

[algogeeks] Re: Amazon Interview - Algorithms

2011-01-22 Thread rajessge...@yahoo.com
it can be done in greedy #includestdio.h #includeiostream #includestack using namespace std; int main() { int n,i,j,count=0; scanf(%d,n); int a[n+1],set=0; a[0]=-1; for(int i=1;i=n;i++) scanf(%d,a[i]); stackint s; i=1; j=n; while(j!=1) { set=0; for(i=1;i=n;i++) { if(j-i=a[i]) {printf(%d,i); j=i;

[algogeeks] Re: nearest points

2011-01-22 Thread alexsolo
http://en.wikipedia.org/wiki/Kd-tree -- 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 unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For

[algogeeks] Complexity Help ??

2011-01-22 Thread Decipher
fun(n) { if(n=2) return (1); else return ((fun(n-1)*fun(n-2)); } find the order of complexity . -- 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 unsubscribe from this group,

Re: [algogeeks] Complexity Help ??

2011-01-22 Thread abhijith reddy
O(2^n) On Sat, Jan 22, 2011 at 8:58 PM, Decipher ankurseth...@gmail.com wrote: fun(n) { if(n=2) return (1); else return ((fun(n-1)*fun(n-2)); } find the order of complexity . -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post

Re: [algogeeks] Complexity Help ??

2011-01-22 Thread Decipher
Could u pls explain ?? -- 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 unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options,

Re: [algogeeks] Complexity Help ??

2011-01-22 Thread Preetam Purbia
T(n) = T(n-1) + T(n-2) + O(1) On Sat, Jan 22, 2011 at 11:28 PM, Decipher ankurseth...@gmail.com wrote: Could u pls explain ?? -- 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 - printf

2011-01-22 Thread LALIT SHARMA
*case 1 :* #include stdio.h #include math.h #include conio.h int main() { float i = 2.5; printf (%f %f\n, floor(i), ceil(i)); getch(); return 0; } *ans : 2.00 3.00* *case 2: * #include stdio.h #include math.h #include conio.h int main() { float i = 2.5; printf (%d

[algogeeks] i need Theory Of Computation By Sipser's Solution Mannual

2011-01-22 Thread rahul rai
-- can somebody give me sipser soluton mannual -- 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 unsubscribe from this group, send email to

Re: [algogeeks] Distance in a dictionary

2011-01-22 Thread Algoose chase
To add to what nishaanth mentioned, I think we should also track all the state transitions so that we can back track and make alternate transitions if the path that was already taken was later found to be incorrect one which will not help to reach the given target (with the given set of words).