[algogeeks] Re: finding all combination
@atul007: When you mean n^2 solution.. did you mean the DP which actually is 2^n?? -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To view this discussion on the web visit https://groups.google.com/d/msg/algogeeks/-/MrOfjqZKk8YJ. 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, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] Re: finding all combination
@shady , prakash : we have to find all combination , not one so could you providelittle more explanation by using 0-1 knapsack. @ sravanreddy001: yeah it should be O(2^n). On Fri, Jan 6, 2012 at 8:07 PM, sravanreddy001 sravanreddy...@gmail.comwrote: @atul007: When you mean n^2 solution.. did you mean the DP which actually is 2^n?? -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To view this discussion on the web visit https://groups.google.com/d/msg/algogeeks/-/MrOfjqZKk8YJ. 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en.
[algogeeks] Fwd: [cse_hbatch2009] Friends - Play the online treasure hunt of Abacus12
-- Forwarded message -- From: Pradeep pradeepm1...@gmail.com Date: Fri, Jan 6, 2012 at 8:34 PM Subject: [cse_hbatch2009] Friends - Play the online treasure hunt of Abacus12 To: cse_hbatch2...@yahoogroups.co.in ** What makes your body temperature to shoot up? What makes your brain dance up and down? Yes, it’s a riddle that makes your brain razor-sharp and it’s a riddle that has brought you here. So, welcome to the *Da-Vinci code : The official online web hunt of Abacus 12 .* The event will focus primarily on testing your lateral thinking abilities and out of the box thinking skills. commencer à jouer - www.abacus.org.in/davinci/play.php Register in our site to start playing - www.abacus.org.in Test Run started...Main Event has just started...! M.Pradeep __._,_.___ Reply to senderpradeepm1...@gmail.com?subject=Re%3A%20Friends%20-%20Play%20the%20online%20treasure%20hunt%20of%20Abacus12| Reply to groupcse_hbatch2...@yahoogroups.co.in?subject=Re%3A%20Friends%20-%20Play%20the%20online%20treasure%20hunt%20of%20Abacus12| Reply via web posthttp://in.groups.yahoo.com/group/cse_hbatch2009/post;_ylc=X3oDMTJwOW1nb2Z1BF9TAzk3NDkwNDgxBGdycElkAzYxMTc2NTkwBGdycHNwSWQDMTcyMDA3NzYyNARtc2dJZAMyNzAEc2VjA2Z0cgRzbGsDcnBseQRzdGltZQMxMzI1ODYyMjQ4?act=replymessageNum=270| Start a new topichttp://in.groups.yahoo.com/group/cse_hbatch2009/post;_ylc=X3oDMTJmanNrdjFmBF9TAzk3NDkwNDgxBGdycElkAzYxMTc2NTkwBGdycHNwSWQDMTcyMDA3NzYyNARzZWMDZnRyBHNsawNudHBjBHN0aW1lAzEzMjU4NjIyNDg- Messages in this topichttp://in.groups.yahoo.com/group/cse_hbatch2009/message/270;_ylc=X3oDMTMzMXNvZW5kBF9TAzk3NDkwNDgxBGdycElkAzYxMTc2NTkwBGdycHNwSWQDMTcyMDA3NzYyNARtc2dJZAMyNzAEc2VjA2Z0cgRzbGsDdnRwYwRzdGltZQMxMzI1ODYyMjQ4BHRwY0lkAzI3MA--( 1) Recent Activity: Visit Your Grouphttp://in.groups.yahoo.com/group/cse_hbatch2009;_ylc=X3oDMTJmYWxxZWwzBF9TAzk3NDkwNDgxBGdycElkAzYxMTc2NTkwBGdycHNwSWQDMTcyMDA3NzYyNARzZWMDdnRsBHNsawN2Z2hwBHN0aW1lAzEzMjU4NjIyNDg- [image: Yahoo! Groups]http://in.groups.yahoo.com/;_ylc=X3oDMTJlbzRxaDJjBF9TAzk3NDkwNDgxBGdycElkAzYxMTc2NTkwBGdycHNwSWQDMTcyMDA3NzYyNARzZWMDZnRyBHNsawNnZnAEc3RpbWUDMTMyNTg2MjI0OA-- Switch to: Text-Onlycse_hbatch2009-traditio...@yahoogroups.co.in?subject=Change+Delivery+Format:+Traditional, Daily Digestcse_hbatch2009-dig...@yahoogroups.co.in?subject=Email+Delivery:+Digest• Unsubscribecse_hbatch2009-unsubscr...@yahoogroups.co.in?subject=Unsubscribe• Terms of Use http://in.docs.yahoo.com/info/terms/ . __,_._,___ -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en.
[algogeeks] Re: finding all combination
@ The following link might help.. http://groups.google.com/group/algogeeks/browse_thread/thread/8a58ea05c96f811b?hl=en# Basicaly if A[N, Wmax] = 1, then find all subsets using backtracking.. where, N = no. of elements, Wmax = 4... On Jan 6, 7:50 pm, atul anand atul.87fri...@gmail.com wrote: @shady , prakash : we have to find all combination , not one so could you providelittle more explanation by using 0-1 knapsack. @ sravanreddy001: yeah it should be O(2^n). On Fri, Jan 6, 2012 at 8:07 PM, sravanreddy001 sravanreddy...@gmail.comwrote: @atul007: When you mean n^2 solution.. did you mean the DP which actually is 2^n?? -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To view this discussion on the web visit https://groups.google.com/d/msg/algogeeks/-/MrOfjqZKk8YJ. 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] Re: finding all combination
@atul007: the 0-1 knapsack is a special case of subset sum problem, (and.. i don't think its easy to find all the solutions using 0/1 knapsack.. ) @shady: is it possible? -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To view this discussion on the web visit https://groups.google.com/d/msg/algogeeks/-/2xspry_EJxoJ. 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, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] find point lies in side circle
@dabbcomputers: looking at the worstcase, listing all points in the set itself takes O(n) time, just to speed up the time would be sort all the points(x,y) wrt x-values another with sorting on y-values, and restrict the target solution space to (x +(or)- R) (y +(or)- R) and work on those points, its easy to get the list of points with in the range on a sorted set. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To view this discussion on the web visit https://groups.google.com/d/msg/algogeeks/-/U9qrk3cVSlEJ. 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, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] C output????
@arun: http://mindprod.com/jgloss/immutable.html this might help you, in essense, if a compiler treats them as immutable, the reason is to reduce the overhead of creating another contant literal (as explain at the link, the string literals are the most commonly used) this is from a java (or higher than C languages) just got to know that this is in C too... -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To view this discussion on the web visit https://groups.google.com/d/msg/algogeeks/-/vcZVkFcVEwoJ. 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, visit this group at http://groups.google.com/group/algogeeks?hl=en.
[algogeeks] C QUESTION???
Wat is the use of ## in define?? #include stdio.h #define f(g,g2) g##g2 void main() { int var12 =100; printf(%d,f(var,12)); } o/p :100 -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To view this discussion on the web visit https://groups.google.com/d/msg/algogeeks/-/o1OhOAqADHgJ. 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, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] C QUESTION???
it joins the variables together ... for eg 1##2 = 12 -- *Parag Khanna B.tech Final Year NIT,Kurukshetra* -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] C QUESTION???
On Sat, Jan 7, 2012 at 12:36 AM, parag khanna khanna.para...@gmail.comwrote: it joins the variables together ... for eg 1##2 = 12 or a##b=ab -- *Parag Khanna B.tech Final Year NIT,Kurukshetra* -- *Parag Khanna B.tech Final Year NIT,Kurukshetra* -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] Re: sqrt function...
when ever you need to calculate values or solve a equations,apply discrete mathematics like newton raphson method it coverges very fast. On Thu, Jan 5, 2012 at 3:50 PM, WgpShashank shashank7andr...@gmail.comwrote: you may also like it , explained two algorithm , discussed about complexities , let me know if anything wrong :) http://shashank7s.blogspot.com/2011/02/wap-to-calculate-square-root-of-number.html Thanks Shashank Mani Computer Science Birla Institute of Technology,Mesra *http://shashank7s.blogspot.com* -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To view this discussion on the web visit https://groups.google.com/d/msg/algogeeks/-/cfkrVqrSNGsJ. 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Regards Aditya Kumar B-tech IV 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 algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
[algogeeks] Re: finding all combination
Given an array A[n], start by sorting the array. Then do something like this: int result[n]; int size=0; void findSubset(int sum, int position=0) { if (sum == 0) output(result, size); for(int i = position; i n; ++i) { if (A[i] sum) break; result[size++] = A[i]; findSubset(i+1, sum-A[i]); --size; } } Call it like this: findSubset(4); Don On Jan 3, 5:26 am, atul anand atul.87fri...@gmail.com wrote: There is integer array like {1,2,4,5,6,1,2,4,3,5,7,2,1}. I want to find the possible combination which will sum to 4. input : {1,2,4,5,6,1,2,4,3,5,7,2,1} output : {1,1,2}, {2,2}, {3,1}, {1,2,1}{4}...etc which make the sum as 4 any approach better than O(n^2) ??? -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] C QUESTION???
@parag thnx... btw is dere ny source dat has ny info bout it?? Regards, Payal Gupta, 3rd year, NIT-Bhopal On Sat, Jan 7, 2012 at 12:36 AM, parag khanna khanna.para...@gmail.comwrote: On Sat, Jan 7, 2012 at 12:36 AM, parag khanna khanna.para...@gmail.comwrote: it joins the variables together ... for eg 1##2 = 12 or a##b=ab -- *Parag Khanna B.tech Final Year NIT,Kurukshetra* -- *Parag Khanna B.tech Final Year NIT,Kurukshetra* -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en.
[algogeeks] Re: finding all combination
Given an array A[n], start by sorting the array. Then do something like this: int result[n]; int size=0; void findSubset(int sum, int position=0) { if (sum == 0) output(result, size); for(int i = position; i n; ++i) { if (A[i] sum) break; result[size++] = A[i]; findSubset(sum-A[i], i+1); --size; } } Call it like this: findSubset(4); Don On Jan 3, 5:26 am, atul anand atul.87fri...@gmail.com wrote: There is integer array like {1,2,4,5,6,1,2,4,3,5,7,2,1}. I want to find the possible combination which will sum to 4. input : {1,2,4,5,6,1,2,4,3,5,7,2,1} output : {1,1,2}, {2,2}, {3,1}, {1,2,1}{4}...etc which make the sum as 4 any approach better than O(n^2) ??? -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] Re: finding all combination
@all Yes it is possible to find the solution using 0/1 knapsack.The approach would be similar as in case of LCS problem when many LCS are possible.Though the implementation could be a bit difficult.For each subproblem when the choice of dubproblems become equally beneficial start a new thread with both the subproblems... Saurabh Singh B.Tech (Computer Science) MNNIT blog:geekinessthecoolway.blogspot.com On Sat, Jan 7, 2012 at 2:01 AM, Don dondod...@gmail.com wrote: Given an array A[n], start by sorting the array. Then do something like this: int result[n]; int size=0; void findSubset(int sum, int position=0) { if (sum == 0) output(result, size); for(int i = position; i n; ++i) { if (A[i] sum) break; result[size++] = A[i]; findSubset(sum-A[i], i+1); --size; } } Call it like this: findSubset(4); Don On Jan 3, 5:26 am, atul anand atul.87fri...@gmail.com wrote: There is integer array like {1,2,4,5,6,1,2,4,3,5,7,2,1}. I want to find the possible combination which will sum to 4. input : {1,2,4,5,6,1,2,4,3,5,7,2,1} output : {1,1,2}, {2,2}, {3,1}, {1,2,1}{4}...etc which make the sum as 4 any approach better than O(n^2) ??? -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] C QUESTION???
yes payal read a standard c book like dennis ritchie ... these are the best source On Sat, Jan 7, 2012 at 1:53 AM, payal gupta gpt.pa...@gmail.com wrote: @parag thnx... btw is dere ny source dat has ny info bout it?? Regards, Payal Gupta, 3rd year, NIT-Bhopal On Sat, Jan 7, 2012 at 12:36 AM, parag khanna khanna.para...@gmail.comwrote: On Sat, Jan 7, 2012 at 12:36 AM, parag khanna khanna.para...@gmail.comwrote: it joins the variables together ... for eg 1##2 = 12 or a##b=ab -- *Parag Khanna B.tech Final Year NIT,Kurukshetra* -- *Parag Khanna B.tech Final Year NIT,Kurukshetra* -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- *UTKARSH SRIVASTAV CSE-3 B-Tech 3rd Year @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 algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] C QUESTION???
## concatenating operator On Sat, Jan 7, 2012 at 9:01 AM, UTKARSH SRIVASTAV usrivastav...@gmail.comwrote: yes payal read a standard c book like dennis ritchie ... these are the best source On Sat, Jan 7, 2012 at 1:53 AM, payal gupta gpt.pa...@gmail.com wrote: @parag thnx... btw is dere ny source dat has ny info bout it?? Regards, Payal Gupta, 3rd year, NIT-Bhopal On Sat, Jan 7, 2012 at 12:36 AM, parag khanna khanna.para...@gmail.comwrote: On Sat, Jan 7, 2012 at 12:36 AM, parag khanna khanna.para...@gmail.comwrote: it joins the variables together ... for eg 1##2 = 12 or a##b=ab -- *Parag Khanna B.tech Final Year NIT,Kurukshetra* -- *Parag Khanna B.tech Final Year NIT,Kurukshetra* -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- *UTKARSH SRIVASTAV CSE-3 B-Tech 3rd Year @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 algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] C QUESTION???
@utkarsh n tejbala ...thnx..4 d info. Regards, Payal gupta, 3rd year,cse, NIT-Bhopal On Sat, Jan 7, 2012 at 9:30 AM, teja bala pawanjalsa.t...@gmail.com wrote: ## concatenating operator On Sat, Jan 7, 2012 at 9:01 AM, UTKARSH SRIVASTAV usrivastav...@gmail.com wrote: yes payal read a standard c book like dennis ritchie ... these are the best source On Sat, Jan 7, 2012 at 1:53 AM, payal gupta gpt.pa...@gmail.com wrote: @parag thnx... btw is dere ny source dat has ny info bout it?? Regards, Payal Gupta, 3rd year, NIT-Bhopal On Sat, Jan 7, 2012 at 12:36 AM, parag khanna khanna.para...@gmail.comwrote: On Sat, Jan 7, 2012 at 12:36 AM, parag khanna khanna.para...@gmail.com wrote: it joins the variables together ... for eg 1##2 = 12 or a##b=ab -- *Parag Khanna B.tech Final Year NIT,Kurukshetra* -- *Parag Khanna B.tech Final Year NIT,Kurukshetra* -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- *UTKARSH SRIVASTAV CSE-3 B-Tech 3rd Year @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 algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en.