[algogeeks] [brain teaser ] 2april
*WHAT AM I Problem Solution* * *The beginning of eternity. The end of time and space. The beginning of every end and the end of every place. What am I? *Update Your Answers at *: Click Herehttp://dailybrainteaser.blogspot.com/2011/04/2april.html?lavesh=lavesh Solution: Will be updated after 1 day -- Never explain yourself. Your friends don’t need it and your enemies won’t believe it . -- 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] Dp problem
You have to paint N boards of length {B1, B2, B3… BN}. There are K painters available and you are also given how much time a painter takes to paint 1 unit of board. You have to get this job done as soon as possible under the constraints that any painter will only paint continuous sections of board, say board {2, 3, 4} or only board {1} or nothing but not board {2, 4, 5}. -- 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] Dp problem
i think this problem can be solved by binary search correct me if i m wrong On Mon, Apr 4, 2011 at 2:36 PM, rajat ahuja catch.rajatah...@gmail.com wrote: You have to paint N boards of length {B1, B2, B3… BN}. There are K painters available and you are also given how much time a painter takes to paint 1 unit of board. You have to get this job done as soon as possible under the constraints that any painter will only paint continuous sections of board, say board {2, 3, 4} or only board {1} or nothing but not board {2, 4, 5}. -- 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] Mathematical puzzle
Hi, Just posted a new puzzle here, most of you might not have come across this. http://industryinterviewquestions.blogspot.com/2011/04/find-out-height-of-tree.html -- Munish -- 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] Dp problem
I didnt quite get this problem. Sample case? On 4/4/11, rajat ahuja catch.rajatah...@gmail.com wrote: You have to paint N boards of length {B1, B2, B3… BN}. There are K painters available and you are also given how much time a painter takes to paint 1 unit of board. You have to get this job done as soon as possible under the constraints that any painter will only paint continuous sections of board, say board {2, 3, 4} or only board {1} or nothing but not board {2, 4, 5}. -- 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. -- Sent from my mobile device -- 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] Dp problem
like u hav boards of length of length 7 2 6 9 4 and u hav 3 painters who can work ||ly so now one way to distribute is (7 )(2 6 9) (4) so time in ths case is 17 suppose we do (7 2)(6)(9 4) time in ths case is 13 or i can do (7 2)(6 9 )(4) time in ths case is 15 i m takin 1 unit time to paint one meter so it is directly equal to length so we hav to make time and ans is 13 On Mon, Apr 4, 2011 at 3:11 PM, Rakib Ansary Saikot ansaryfantas...@gmail.com wrote: I didnt quite get this problem. Sample case? On 4/4/11, rajat ahuja catch.rajatah...@gmail.com wrote: You have to paint N boards of length {B1, B2, B3… BN}. There are K painters available and you are also given how much time a painter takes to paint 1 unit of board. You have to get this job done as soon as possible under the constraints that any painter will only paint continuous sections of board, say board {2, 3, 4} or only board {1} or nothing but not board {2, 4, 5}. -- 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. -- Sent from my mobile device -- 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] Dp problem
I think we can do it this way. Sum(all boards length) / K = A ( tentative avg. lenght to be painted by each painter) Now start from B1, and keep going further till Bi, till Sum(B1-Bi) is less than A. So this goes to painter P1. Same way for P2, start from i+1 till j. Condition: If i+1 itself is A. Then new A = length(B i+1). Keep going like this till Bn On Mon, Apr 4, 2011 at 3:20 PM, rajat ahuja catch.rajatah...@gmail.comwrote: like u hav boards of length of length 7 2 6 9 4 and u hav 3 painters who can work ||ly so now one way to distribute is (7 )(2 6 9) (4) so time in ths case is 17 suppose we do (7 2)(6)(9 4) time in ths case is 13 or i can do (7 2)(6 9 )(4) time in ths case is 15 i m takin 1 unit time to paint one meter so it is directly equal to length so we hav to make time and ans is 13 On Mon, Apr 4, 2011 at 3:11 PM, Rakib Ansary Saikot ansaryfantas...@gmail.com wrote: I didnt quite get this problem. Sample case? On 4/4/11, rajat ahuja catch.rajatah...@gmail.com wrote: You have to paint N boards of length {B1, B2, B3… BN}. There are K painters available and you are also given how much time a painter takes to paint 1 unit of board. You have to get this job done as soon as possible under the constraints that any painter will only paint continuous sections of board, say board {2, 3, 4} or only board {1} or nothing but not board {2, 4, 5}. -- 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. -- Sent from my mobile device -- 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. -- Munish -- 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] Algo to identify loose ends of each cable in minimum time.
Hi, Just posted another problem, which comes in category of hard problems. http://industryinterviewquestions.blogspot.com/2011/04/least-number-of-trips-to-number-wires.html -- Munish -- 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] CFP with Extended Deadline of Apr. 10: The 2011 Intl. Conf. on Software Engineering Research and Practice (SERP'11), USA, July 18-21, 2011
Dear Colleagues: Please share the announcement below with those who may be interested. Thank you, Organizing Committee CALL FOR PAPERS === Extended Paper Submission Deadline: April 10, 2011 SERP'11 The 2011 International Conference on Software Engineering Research and Practice July 18-21, 2011, Las Vegas, USA http://www.world-academy-of-science.org/ === You are invited to submit a full paper for consideration. All accepted papers will be published in the SERP conference proceedings (in printed book form; later, the proceedings will also be accessible online) - the proceedings will be indexed in Inspec / IET / The Institute for Engineering Technology, DBLP / Computer Science Bibliography, and others. Those interested in proposing workshops/sessions, should refer to the relevant sections that appear below. The main keynote lecture will be delivered by Prof. David Lorge Parnas (Fellow of IEEE, ACM, RSC, CAE, GI; MRIA); there will also be 8 other distinguished speakers, 12 planned tutorials and panel discussions as well as about 70 research paper presentations. SCOPE: Topics of interest include, but are not limited to, the following: O Software architectures O Software design and design patterns O Architectural analysis, verifications and validation methods O Quality oriented software architecture (design and Support) O Software reliability, safety critical systems and security methods O Software reuse and component engineering O UML/MDA and AADL O Object oriented technology (design and analysis) O Software metrics O Reverse and architectural recovery methods O Domain specific software engineering O Aerospace software and system engineering O Software engineering methodologies O Survivable systems O Engineering of safety/mission critical systems O Software testing, evaluation and analysis technologies O Workflow - Computer Supported Cooperative Work (CSCW) O Project management issues O Distributed and parallel systems O Legal issues and standards O Automated software design O Real-time embedded software engineering O Automated software design and synthesis O Software security engineering O Theoretic approaches (formal methods, graph, ...) O Software, domain modeling and meta-modeling O Model driven engineering O Software maintenance O Reflection and metadata methodologies O AI approaches to software engineering O Component based software engineering O Software engineering standards and guidelines O Reports on intelligent CASE tools and eclipse plugins issues O Multimedia in software engineering O Usability engineering O Novel software tools and environments O Pervasive software engineering O Requirement engineering and processes O Critical and embedded software design O Service oriented software architecture O Software cost estimation O Web engineering and web-based applications O Human computer interaction and usability engineering O Model based software engineering O Aspect oriented software engineering O Agent oriented software engineering O Programming languages and compilers O Education and law O Case studies and emerging technologies USEFUL WEB LINKS: To see the DBLP list of accepted papers of SERP 2010, go to: http://www.informatik.uni-trier.de/~ley/db/conf/serp/serp2010.html The main web site of SERP'11 can be accessed via: http://www.world-academy-of-science.org/ IMPORTANT DATES: April 10, 2011: Submission of papers (about 5 to 7 pages) April 25-30, 2011: Notification of acceptance (+/- 6 days) May 7, 2011: Final papers + Copyright/Consent + Registration July 18-21, 2011: The 2011 International Conference on Software Engineering Research and Practice (SERP'11) ACADEMIC CO-SPONSORS: Currently being prepared - The Academic sponsors of the last offering of SERP (2010) included research labs and centers affiliated with (a partial list): University of California, Berkeley; University of Southern California; University of Texas at Austin; Harvard University, Cambridge, Massachusetts; Georgia Institute of Technology, Georgia; Emory University, Georgia; University of Minnesota; University of Iowa; University of North Dakota; NDSU-CIIT Green Computing Comm. Lab.; University of Siegen, Germany; UMIT, Austria; SECLAB (University of Naples Federico II + University of Naples Parthenope + Second University of Naples, Italy); National Institute for Health Research; World Academy of Biomedical Sciences and Technologies; Russian Academy of Sciences, Russia; International Society of Intelligent Biological Medicine (ISIBM4042); The International Council on Medical and Care Compunetics; Eastern Virginia Medical School the American College of Surgeons, USA. SUBMISSION OF PAPERS:
Re: [algogeeks] Dp problem
then please share wid me yaar thanks in advance On Mon, Apr 4, 2011 at 4:30 PM, Manmeet Singh mans.aus...@gmail.com wrote: Simple Dp On Mon, Apr 4, 2011 at 3:33 PM, Munish Goyal munish.go...@gmail.comwrote: I think we can do it this way. Sum(all boards length) / K = A ( tentative avg. lenght to be painted by each painter) Now start from B1, and keep going further till Bi, till Sum(B1-Bi) is less than A. So this goes to painter P1. Same way for P2, start from i+1 till j. Condition: If i+1 itself is A. Then new A = length(B i+1). Keep going like this till Bn On Mon, Apr 4, 2011 at 3:20 PM, rajat ahuja catch.rajatah...@gmail.comwrote: like u hav boards of length of length 7 2 6 9 4 and u hav 3 painters who can work ||ly so now one way to distribute is (7 )(2 6 9) (4) so time in ths case is 17 suppose we do (7 2)(6)(9 4) time in ths case is 13 or i can do (7 2)(6 9 )(4) time in ths case is 15 i m takin 1 unit time to paint one meter so it is directly equal to length so we hav to make time and ans is 13 On Mon, Apr 4, 2011 at 3:11 PM, Rakib Ansary Saikot ansaryfantas...@gmail.com wrote: I didnt quite get this problem. Sample case? On 4/4/11, rajat ahuja catch.rajatah...@gmail.com wrote: You have to paint N boards of length {B1, B2, B3… BN}. There are K painters available and you are also given how much time a painter takes to paint 1 unit of board. You have to get this job done as soon as possible under the constraints that any painter will only paint continuous sections of board, say board {2, 3, 4} or only board {1} or nothing but not board {2, 4, 5}. -- 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. -- Sent from my mobile device -- 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. -- Munish -- 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.
[algogeeks] Facebook Interview Question....Heavy Number
Hi Geeks, One of The My Friend had This Question in His Technical Round of Facebook, I m going to share with you.lest see how geek approach this...Plz don't make this post spam..by discussing whats ur friend name, wich colge, etc etc..just share your approach, think solve the question, even Google search wont give you correct efficient approach ,answer for this question..so think your self.. O(n^2) Solution is Obvious ..but .it wont work for 10 million as a limit so not a good solution we have to solve it using best approach algo..as we have so here is the question...From Facebook... /* A non-negative integer is called heavy if the average value of its digits in decimal representation exceeds 7. Assume that 0 has average value of its digits equal to 0. For example the number 8698 is heavy, because the average value of its digits equal to (8+6+9+8)/4 = 7.75. The number 53141 has the average value of its digits equal to (5+3+1+4+1)/5 = 2.6, so it is not heavy. Write a function int heavy_decimal_count(int a,int b); that given two non-negative integers A and B returns the number of heavy integers in the interval [A..B] (both ends included). Assume that 0 =A = B = 200,000,000 Range Given ..It Really Matters Your Program should not give time out memory error For example, given A=8,675 and B=8,689 the function should return 5, because there are 5 heavy integers in range [8,675..8,689]: 8675 avg=6.5 8676 avg=6.75 8677 avg=7 8678 avg=7.25HEAVY 8679 avg=7.5 HEAVY 8680 avg=5.5 8681 avg=5.75 8682 avg=6 8683 avg=6.25 8684 avg=6.5 8685 avg=6.75 8686 avg=7 8687 avg=7.25HEAVY 8688 avg=7.5 HEAVY 8689 avg=7.75HEAVY you have to keep in mind for given range e.g given B=2 Billion Its Man Thing so what happen when A=1 Billion B=2 Billion */ Go Ahead Thanks Regards Shashank Mani Cell 9740852296 -- 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] COLL COLL BANEGA
hot lipkiss http://hotactressstoyou.blogspot.com/2011/04/lipkiss-2.html lipkiss in without dress http://hotactressstoyou.blogspot.com/2011/04/lipkiss.html seepika padukone sexy back look http://hotactressstoyou.blogspot.com/2011/04/deepika-padukone.html sexy katrina kaif http://hotactressstoyou.blogspot.com/2011/04/katrina-kaif.html beauty keerthi chawla http://hotactressstoyou.blogspot.com/2011/04/keerthi-chawla.html saloni sexy photos http://hotactressstoyou.blogspot.com/2011/04/saloni.html deeksha seth in a hot saree http://hotactressstoyou.blogspot.com/2011/04/deeksha-seth.html asin hot wallpapers http://hotactressstoyou.blogspot.com/2011/04/asin.html ramba in a red dress http://hotactressstoyou.blogspot.com/2011/04/ramba.html sexy ilieana is in scert http://hotactressstoyou.blogspot.com/2011/04/ileana.html -- 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] Facebook Interview Question....Heavy Number
I am not sure if I can explain the general approach as efficiently as by explaining with an example: for the example you have give , say to find for A= 1,000,000,000 - 2,000,000,000 first two billion is not heavy. So finding from 1,000,000,000 - 1,999,999,999 It is:( 1 + sigma (x) ) 70 , where sigma( x ) is the sum of the rest of the nine integers. so, sigma(x) 69. so its now a problem of finding the sum of 9 digits to exceed the sum 69. If someone could work this permutation problem please put it up, I am trying to come up with an accurate formula for this. Generalizing, split the range into units that can be brought into this workable form and apply the formula. On Mon, Apr 4, 2011 at 8:52 AM, bittu shashank7andr...@gmail.com wrote: Hi Geeks, One of The My Friend had This Question in His Technical Round of Facebook, I m going to share with you.lest see how geek approach this...Plz don't make this post spam..by discussing whats ur friend name, wich colge, etc etc..just share your approach, think solve the question, even Google search wont give you correct efficient approach ,answer for this question..so think your self.. O(n^2) Solution is Obvious ..but .it wont work for 10 million as a limit so not a good solution we have to solve it using best approach algo..as we have so here is the question...From Facebook... /* A non-negative integer is called heavy if the average value of its digits in decimal representation exceeds 7. Assume that 0 has average value of its digits equal to 0. For example the number 8698 is heavy, because the average value of its digits equal to (8+6+9+8)/4 = 7.75. The number 53141 has the average value of its digits equal to (5+3+1+4+1)/5 = 2.6, so it is not heavy. Write a function int heavy_decimal_count(int a,int b); that given two non-negative integers A and B returns the number of heavy integers in the interval [A..B] (both ends included). Assume that 0 =A = B = 200,000,000 Range Given ..It Really Matters Your Program should not give time out memory error For example, given A=8,675 and B=8,689 the function should return 5, because there are 5 heavy integers in range [8,675..8,689]: 8675 avg=6.5 8676 avg=6.75 8677 avg=7 8678 avg=7.25 HEAVY 8679 avg=7.5 HEAVY 8680 avg=5.5 8681 avg=5.75 8682 avg=6 8683 avg=6.25 8684 avg=6.5 8685 avg=6.75 8686 avg=7 8687 avg=7.25 HEAVY 8688 avg=7.5 HEAVY 8689 avg=7.75 HEAVY you have to keep in mind for given range e.g given B=2 Billion Its Man Thing so what happen when A=1 Billion B=2 Billion */ Go Ahead Thanks Regards Shashank Mani Cell 9740852296 -- 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. -- Best, T Anand Karthik, Contact number: +91-9571552652 -- 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]
Given 3 strings of only lowercase letter you have to count the number of ways you can construct the third string by combining two subsequences from the first two strings. After deleting 0 or more characters from a string we can get its subsequence. For example “a”, “b”, “c”, “ab”, “ac”, “bc” and “abc” all the strings are the subsequences of “abc”. A subsequence may also be empty. Now suppose there are two subsequences “abc” and “de”. By combining them you can get the following strings “abcde”, “abdce”, “abdec”, “adbce”, “adbec”, “adebc”, “dabce”, “dabec”, “daebc” and “deabc”. *Input* The first line of the input contains a single integer T (0T271) indicating the number of test cases. Each test case contains 3 strings containing only lowercase characters. The lengths of the strings are between 1 and 60. *Output* For each test case output a single integer denoting the number of ways you can construct the third string from the first two string by the above way. The result may be very large. You should output the result%10007. *Sample Input Output for Sample Input* *2* *abc** abc abc* *abbcd** bccde abcde* * * *8* *18* * * -- 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] [brain teaser ] 2april
E On Apr 4, 2011 1:14 PM, Lavesh Rawat lavesh.ra...@gmail.com wrote: *WHAT AM I Problem Solution* * *The beginning of eternity. The end of time and space. The beginning of every end and the end of every place. What am I? *Update Your Answers at *: Click Here http://dailybrainteaser.blogspot.com/2011/04/2april.html?lavesh=lavesh Solution: Will be updated after 1 day -- Never explain yourself. Your friends don’t need it and your enemies won’t believe it . -- 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] Are U a Student Must Read this Frwd This Please If u Like We R student like You TOO
so many mails, yucks, someone kick him out of the algogeeks group it seems like your only objective here is to promote your site never seen anyone promoting wikipedia, and it is read by majority of the people around the world. On Mon, Apr 4, 2011 at 9:51 PM, ArPiT BhAtNaGaR arpitbhatnagarm...@gmail.com wrote: so soory its www.kampusattack.comagain sorry On Fri, Apr 1, 2011 at 1:17 AM, hary rathor harry.rat...@gmail.comwrote: everybody want to be mark. -- 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. -- Arpit Bhatnagar (MNIT JAIPUR) -- 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] Need help on Divide and Conquer Algorithm
Question :Let A[1..n] be an array of integers. Design an efficient divide and conquer algorithm to determine if A contains a majority element, i.e an element appears more than n/2 times in A. What is the time complexity of your algorithm? Answer: a[1..n] is an array int majorityElement(int a[], int first, int last) { If (first = = last) { return a[first]; // Array has one element and its count = 1 and it is major element } mid= (first+last)/2; (majorL,countL)= majorityElement(a,first,mid); (majorR,countR)= majorityElement(a,mid +1,last); n = total elements in an array; If(majorL==majorR) return(countL+countR); else { If(countLcountR) return(majorL,countL); elseif(countL countR) return(majorR,countR); else return(majorL,majorR); } if(countLn/2) temp1=majorL; if(countRn/2) temp2=majorR; If(temp1 = = temp2) return temp1; elseif(countLcountR) return temp1; else (countRcountL) return temp2; else return -1; } int main() { int a[8] = {2,3,2,2,4,2,2,2}; int first =1; int last=8; //change the value of last when the array increases or decreases in size int x = majorityElement(a,first,last); if(x= = -1) printf(“No Majority Element”) else Majority element = x; } -- 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] Dp problem
read topcoder tutorial binary search...u will get an idea On Mon, Apr 4, 2011 at 4:38 PM, rajat ahuja catch.rajatah...@gmail.com wrote: then please share wid me yaar thanks in advance On Mon, Apr 4, 2011 at 4:30 PM, Manmeet Singh mans.aus...@gmail.com wrote: Simple Dp On Mon, Apr 4, 2011 at 3:33 PM, Munish Goyal munish.go...@gmail.com wrote: I think we can do it this way. Sum(all boards length) / K = A ( tentative avg. lenght to be painted by each painter) Now start from B1, and keep going further till Bi, till Sum(B1-Bi) is less than A. So this goes to painter P1. Same way for P2, start from i+1 till j. Condition: If i+1 itself is A. Then new A = length(B i+1). Keep going like this till Bn On Mon, Apr 4, 2011 at 3:20 PM, rajat ahuja catch.rajatah...@gmail.com wrote: like u hav boards of length of length 7 2 6 9 4 and u hav 3 painters who can work ||ly so now one way to distribute is (7 )(2 6 9) (4) so time in ths case is 17 suppose we do (7 2)(6)(9 4) time in ths case is 13 or i can do (7 2)(6 9 )(4) time in ths case is 15 i m takin 1 unit time to paint one meter so it is directly equal to length so we hav to make time and ans is 13 On Mon, Apr 4, 2011 at 3:11 PM, Rakib Ansary Saikot ansaryfantas...@gmail.com wrote: I didnt quite get this problem. Sample case? On 4/4/11, rajat ahuja catch.rajatah...@gmail.com wrote: You have to paint N boards of length {B1, B2, B3… BN}. There are K painters available and you are also given how much time a painter takes to paint 1 unit of board. You have to get this job done as soon as possible under the constraints that any painter will only paint continuous sections of board, say board {2, 3, 4} or only board {1} or nothing but not board {2, 4, 5}. -- 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. -- Sent from my mobile device -- 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. -- Munish -- 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. -- 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: Algo to identify loose ends of each cable in minimum time.
At the first end, connect pairs of wires together, leaving two wires unconnected. Go to the other end. Find a pair of connected wires, and number them #2 and #3. Find another pair and label them #4 and #5. Repeat for all of the pairs, with the last pair labeled #118 and #119. There remains two wires that are not connected to each other. Label one of these #1 and the other #120. Connect #1 to #2, #3 to #4, etc, leaving #119 and 120 unconnected. Go back to the first end. One of the originally unconnected wires still is unconnected. Label it #120 and label the other originally connected wire #1. Now find the wire connected to #1 and label it #2. The wire that originally was connected with new wire #2 can be labeled #3. The wire that is now connected to the newly labeled #3 is #4. In this way, all of the wires can be identified on both ends in two trips (one round trip). If it is necessary to disconnect the connections at the other end, a third trip is necessary. Dave On Apr 4, 5:17 am, Munish Goyal munish.go...@gmail.com wrote: Hi, Just posted another problem, which comes in category of hard problems. http://industryinterviewquestions.blogspot.com/2011/04/least-number-o... -- Munish -- 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] hey.. geeks
hi friends im a newbie on this and it seems extremely useful group also a live one... ! will be looking ahead for lot many stuff on this -- 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.