[algogeeks] Re: binary search for Linked List?
We can study about Skip list from wiki or so, Assuming that there are no duplicate elements, do we fetch anything from the skp list? Priya, What is the complexity of binary search on skip list with and without duplicate elements. And in what way it would be better than arrays? The whole question asked is about binary search on linked list.. Binary search is possible on Linked lists (In partucular a Sorted Linked list). The Complexity of it would be N/2+N/4+..+1 in worst case, which comes to O(N). In case of binary search on array, the complexity is O(Log N). Sorting of an array will take O(n log n). Can we discuss something on the time complexity of linked listes here. On Mar 11, 10:39 am, UTKARSH SRIVASTAV usrivastav...@gmail.com wrote: what is skip list On Fri, Mar 11, 2011 at 5:58 AM, priya mehta priya.mehta...@gmail.comwrote: use skip list:) On Thu, Mar 10, 2011 at 2:31 PM, ravi teja ravitejal...@gmail.com wrote: @Utkarsh : Yeah , that is when you can access any element in O(1) time and the elements are sorted.This happens in a sorted array where you get an overall complexisty of O(logn). -- 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 SRIVATAV CSE-3 B-TECH 2nd 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.
[algogeeks] [brain teaser ]11march
*Game Show Problem(Old One) Solution* * *You are on a game show and there are three doors. The presenter tells you that behind one of doors there is a car and behind the other two are goats, if you pick the car you win it. After you have picked a door the presenter opens a different door with a goat behind it, he then gives you the chance to change what door you open, what should you do? Update Your Answers at : Click Herehttp://dailybrainteaser.blogspot.com/2011/03/11march.html 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] Re: algo for mirror a tree
can u elaborate a bit ?? with sm example if possible On Mar 11, 4:52 am, priyank desai priyankd...@gmail.com wrote: Do a post order traversal of the tree and swap its child instead of printing the node values. On Mar 10, 8:19 am, Subhransupanigrahi subhransu.panigr...@gmail.com wrote: Hey guys, you guys have came across many time with mirror a tree. if anyone has effective ways interms of memory efficiency way to implement mirror of a tree. Sent from my iPhone -- 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: binary search for Linked List?
http://en.wikipedia.org/wiki/Skip_list hope it helps :) On Fri, Mar 11, 2011 at 2:20 PM, kumar vr kumarg...@gmail.com wrote: We can study about Skip list from wiki or so, Assuming that there are no duplicate elements, do we fetch anything from the skp list? Priya, What is the complexity of binary search on skip list with and without duplicate elements. And in what way it would be better than arrays? The whole question asked is about binary search on linked list.. Binary search is possible on Linked lists (In partucular a Sorted Linked list). The Complexity of it would be N/2+N/4+..+1 in worst case, which comes to O(N). In case of binary search on array, the complexity is O(Log N). Sorting of an array will take O(n log n). Can we discuss something on the time complexity of linked listes here. On Mar 11, 10:39 am, UTKARSH SRIVASTAV usrivastav...@gmail.com wrote: what is skip list On Fri, Mar 11, 2011 at 5:58 AM, priya mehta priya.mehta...@gmail.com wrote: use skip list:) On Thu, Mar 10, 2011 at 2:31 PM, ravi teja ravitejal...@gmail.com wrote: @Utkarsh : Yeah , that is when you can access any element in O(1) time and the elements are sorted.This happens in a sorted array where you get an overall complexisty of O(logn). -- 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 SRIVATAV CSE-3 B-TECH 2nd 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] SPOJ PROBLEM
any test case where this fails by using brute force approach? like this one if c[l]=c[r] then take c[l]*a and l++; else choose c[r]*a and r--; this is o(n) solution. any test case where it fails?? On Thu, Mar 10, 2011 at 11:40 AM, Amol Sharma amolsharm...@gmail.comwrote: Bhaukali Launde !! Maa ka ladla bigad gya !! On Thu, Mar 10, 2011 at 11:36 AM, UTKARSH SRIVASTAV usrivastav...@gmail.com wrote: thnx ashutosh ..tum i love u On Thu, Mar 10, 2011 at 11:11 AM, AnAnDiT AsHu ashu.m...@gmail.comwrote: launda pelu nikla. On Thu, Mar 10, 2011 at 10:22 AM, UTKARSH SRIVASTAV usrivastav...@gmail.com wrote: WELL I HAVE DONE THIS PROBLEM .HERE IS THE CODE #includestdio.h #includealgorithm using namespace std; main() { long long int t[2][2010],price[2010],r,c,i,j,n; scanf(%lld,n); for(i=0;in;i++) { scanf(%lld,price[i]); } for(r=n-1,c=0;r=0c=n-1;r--,c++) { for(i=r,j=n-1;i=0j=c;j--,i--) t[i1][j]=max(price[i]*(n+i-j)+t[(i+1)1][j],price[j]*(n+i-j)+t[i1][j-1]); } printf(%lld\n,t[0][n-1]); return 0; } On Wed, Mar 9, 2011 at 5:10 PM, Algoose chase harishp...@gmail.comwrote: Hi, Any solution other than brute force(exponential growth) for this problem ? On Sun, Mar 6, 2011 at 6:42 PM, UTKARSH SRIVASTAV usrivastav...@gmail.com wrote: can anyone please tell me why i am getting wrong answer for problem.https://www.spoj.pl/problems/TRT/ . . . MY CODE IS THIS AND TO BE TESTED IN gcc COMPILER #includestdio.h double a[2100]; double fun(long long int m,long long int n,double count) { double k,l; count++; if(m==n) { return count*a[m]; } if((k=(fun(m+1,n,count)))(l=(fun(m,n-1,count { return (count*a[m]+k); } else { return (count*a[n]+l); } } int main() { long long int i,m,n; double ans,c=0; scanf(%lld,n); for(i=1;i=n;i++) { scanf(%lf,a[i]); } m=1; ans=fun(m,n,c); printf(%.0lf\n,ans); return 0; } -- 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 SRIVATAV CSE-3 B-TECH 2nd 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. -- UTKARSH SRIVATAV CSE-3 B-TECH 2nd 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. -- Harshal Choudhary, III Year B.Tech Undergraduate, Computer Science and Engineering, National Institute of Technology Surathkal, Karnataka India. -- 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 Immediately Cognos Report Developer -- Cincinnati ,OH !!!!!
Dear Folks, Wishes for the Day !!! We Need consultant for Cognos Report Developer Please share suitable profiles to s...@panzersolutions.com *Job Title : Cognos Report Developer Location : Cincinnati ,OH Duration : 2 Months Rate : $55/Hr* Need someone who can develop 10 reports using the *latest version of Cognos 9 or 10. * -- Thanks and Best Regards, Sam Riley | Sr Technical Recruiter Email: s...@panzersolutions.com Direct: 201-710-8278 -- 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 an integer n , you have to print all the ways in which n can be represented as sum of positive integers
Given an integer n , you have to print all the ways in which n can be represented as sum of positive integers -- 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: Given an integer n , you have to print all the ways in which n can be represented as sum of positive integers
This is a good place to use recursion. One thing you have to know is whether order matters. E.g., are 2 + 1 and 1 + 2 the same or different ways to represent 3 as a sum of positive integers. This choice will affect the way you write the recursive function. Dave On Mar 11, 9:33 am, saurabh agrawal saurabh...@gmail.com wrote: Given an integer n , you have to print all the ways in which n can be represented as sum of positive integers -- 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: Given an integer n , you have to print all the ways in which n can be represented as sum of positive integers
Do it assuming as two cases. On Fri, Mar 11, 2011 at 9:46 PM, Dave dave_and_da...@juno.com wrote: This is a good place to use recursion. One thing you have to know is whether order matters. E.g., are 2 + 1 and 1 + 2 the same or different ways to represent 3 as a sum of positive integers. This choice will affect the way you write the recursive function. Dave On Mar 11, 9:33 am, saurabh agrawal saurabh...@gmail.com wrote: Given an integer n , you have to print all the ways in which n can be represented as sum of positive integers -- 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 Immediately PeopleSoft Business Analyst -- Washington, DC
Dear Folks, Wishes for the Day !!! We Need consultant for PeopleSoft Business Analyst Please share suitable profiles to s...@panzersolutions.com *Job Title : PeopleSoft Business Analyst Location : Washington, DC Duration : 5 months Rate : $50/Hr* PeopleSoft Business Analyst Modules: Payroll and Time Labor Interfaces: GL and Project Costing Need both BA skills and more hands on Functional experience with TL, Payroll functions and Payroll to GL processes. 5 to 7 years of progressive work experience focused on PeopleSoft (or ERP or other large system equivalent) HRMS 8.8 SP1 / 8.9 / or 9.x requirements gathering, configuration, design, documentation, testing, and implementation in full life-cycle projects 2 years of PeopleSoft HRMS 8.9, or 9.x experience specifically with TL, payroll, MSS, and ESS modules. Bachelor's degree or equivalent work experience required Strong oral and written communication skills are preferred -- Thanks and Best Regards, Sam Riley | Sr Technical Recruiter Email: s...@panzersolutions.com Direct: 201-710-8278 -- 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] Print Hello infinite..................
int main(void) { inf_times: printf(Hello); goto inf_times; return 0; } On Fri, Mar 11, 2011 at 7:46 PM, UMESH KUMAR kumar.umesh...@gmail.comwrote: Hi my question is without Loop and Recursion function using??? On Fri, Mar 11, 2011 at 5:40 AM, Abhishek Mallick abhishek.mallick2...@gmail.com wrote: #include stdio.h int main() { while(printf(Hello)); return 0; } On Thu, Mar 10, 2011 at 11:58 AM, Nishant Agarwal nishant.agarwa...@gmail.com wrote: #includestdio.h void print1(); void print2() { printf(Hello\n); print1(); } void print1() { printf(Hello\n); print2(); } int main() { print1(); } On Thu, Mar 10, 2011 at 11:47 AM, nidhi jain nidhi.jain311...@gmail.com wrote: @abhishek:isn't it recursion? -- 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. -- 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 SQL DBA -- FL -- US Citizen or Green Card holde Only !!!!!
Dear Folks, Wishes for the Day !!! We Need consultant for SQL DBA Please share suitable profiles to s...@panzersolutions.com *Job Title : SQL DBA Location : Miamai,FL Duration : 6 Months Rate : Market US Citizen or Green Card holde Only !* SQL DBA: Production Support of the SQL Server Farm. Document Management Project Website Projects SQL Servers Scope of work: Responsible for Administrating SQL server Databases. Review and QA Database Programs Required skills/competencies: Extensive experience in all phases of database administration, including: installation, configuration, physical and logical database design, performance tuning, writing stored procedures, triggers, security, troubleshooting, and managing backup and recovery plans. Extensive experience with replication; configuration and troubleshooting. Proven experience in supporting large production, test, and development database environments. Strong knowledge and understanding of MS SQL Server Clustering. Extensive Transact SQL programming experience. Preferred Skills: Certification as a Microsoft Certified Database Administrator (MCDBA) would be a plus although not required. - Thanks and Best Regards, Sam Riley | Sr Technical Recruiter Email: s...@panzersolutions.com Direct: 201-710-8278 -- 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] spoj problem
CAN ANYONE PLEASE TELL ME WHICH TEST CASE IS WRONG . PROBLEM:https://www.spoj.pl/problems/STREETR/ #includestdio.h main() { long long int n,i,ans,k,flag,m,a[100100],d; scanf(%lld,n); for(i=0;in;i++) { scanf(%lld,a[i]); } d=a[1]-a[0]; m=1; while(d0) { m=1; ans=0; flag=1; for(i=1;in;i++) { if((a[i]-a[0])%d==0) { k=(a[i]-a[0])/d+1; ans=ans+(k-m-1); m=k; } else { flag=0; break; } } if(flag==0||ans==0) d=d-1; else { //h=0; break; } } printf(%lld\n,ans); return 0; } -- UTKARSH SRIVATAV CSE-3 B-TECH 2nd 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.
[algogeeks] Need immediately Biztalk Administrator -- Miami, FL -- US Citizen or Green Card holde Only !!!!!
Dear Folks, Wishes for the Day !!! We Need consultant for Biztalk Administrator Please share suitable profiles to s...@panzersolutions.com *Job Title : Biztalk Administrator Location : Miami, FL Duration : 6 Months Rate : Market US Citizen or Green Card holde Only !* Biztalk Upgrade from Biztalk 2002 to Biztalk 2009. In addition assist in Biztalk production support. Scope of work: Key responsibilities include the identification and resolution of hardware, software or BizTalk problems/outages in any of the RCCL BizTalk related services. Maintaining, creating and deploying BizTalk adapter/channels on multiple platforms across the enterprise. Help with installations, upgrades, application migrations and support of BizTalk for QA and development teams for multiple projects. Participate in performance analysis and certification. These responsibilities require 24x7 coverage and response to systems alerts during after-hour periods. Specific BizTalk performance issues, error messages or service problems will be routed directly to the IT BizTalk Support team and be assigned to a BizTalk Engineer. Required skills/competencies: Required Skills/Experience: • Bachelor's degree (computer science engineering preferred) or related work experience • Systems Engineering experience working in complex enterprise environment • 4+ years BizTalk experience, 2+ years in a 24/7/365 environment • Demonstrated experience with implementation, management and operational support of BizTalk environment Software skills: BizTalk 2002, 2004, 2006,Visual Studio 2005+,C#, XML, XSD, XLST, Web Services, WSDL, TSQL, PLSQL,MSMQ, FTP Preferred Skills: This is a Biztalk Administrator role not a developer Role. Preferred Education: Bachelors Degree - Thanks and Best Regards, Sam Riley | Sr Technical Recruiter Email: s...@panzersolutions.com Direct: 201-710-8278 -- 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 immediately Java Flex developer -- NY !!!!!
Dear Folks, Wishes for the Day !!! We Need consultant for Java Flex developer Please share suitable profiles to s...@panzersolutions.com *Job Title : Java Flex developer Location : NYC, NY Duration : 12 Months Rate : Market* NOTE: FINANCIAL INDUSTRY BACKGROUND IS HIGHLY DESIRABLE. JOB DETAILS: The individual will be a highly motivated developer who will be involved developing a major new application for traders in a rapidly emerging asset class. Ideal candidate should have a strong foundation in object oriented programming, algorithm and data structures. Experience server side Java development with Spring and/or Hibernate, mixed with Flex UI development is a requirement. Database/Functional Programming is a plus. Experience in financial industry is highly desirable. SKILLS REQUIRED: Java Flex OOP SKILLS DESIRED: SQL Database Spring Functional Programming - Thanks and Best Regards, Sam Riley | Sr Technical Recruiter Email: s...@panzersolutions.com Direct: 201-710-8278 -- 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] spoj problem
Try with trees at 1 3 and 5. Gives wrong output: http://ideone.com/KHUdT And after you fix that if you still get TLE, there is a simpler way to solve this. Thanks, Balaji. On Sat, Mar 12, 2011 at 12:55 AM, UTKARSH SRIVASTAV usrivastav...@gmail.com wrote: CAN ANYONE PLEASE TELL ME WHICH TEST CASE IS WRONG . PROBLEM:https://www.spoj.pl/problems/STREETR/ #includestdio.h main() { long long int n,i,ans,k,flag,m,a[100100],d; scanf(%lld,n); for(i=0;in;i++) { scanf(%lld,a[i]); } d=a[1]-a[0]; m=1; while(d0) { m=1; ans=0; flag=1; for(i=1;in;i++) { if((a[i]-a[0])%d==0) { k=(a[i]-a[0])/d+1; ans=ans+(k-m-1); m=k; } else { flag=0; break; } } if(flag==0||ans==0) d=d-1; else { //h=0; break; } } printf(%lld\n,ans); return 0; } -- UTKARSH SRIVATAV CSE-3 B-TECH 2nd 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.
[algogeeks] Interesting Toughest Problem On Telephone PC ..
Hy Guys I want to do . for any phone number .. the program should print out all the possible strings it represents. For eg.) 2 in the number can be replaced by 'a' or 'b' or 'c', 3 by 'd' 'e' 'f' etc. In this way how many possible permutations can be formed from a given phone number. I don't want anyone to write code for it ... a good algorithm or psuedocode would be great. I am talking about old small phone where a single digit corresponds to 3charcter from digit 2 to 8 and digit 9 has 4 character w x y z ..Hope everyone got my points what i wants well i tried my solution but thats become so complex so now even i am facing to understand that so will anybody try this interesting question . more clearly for digit o/p is AD AE AF BD BE BF CD CE CF Now You Can Imegin what will be o/p for 9740852296 or any 10 digit number Think as much as you can but finally solution matters .. Thanks Regards Shashank Mani -- 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] spoj problem
is case main answer 0 hona chahiye. -- Satyam Kapoor B.Tech 2nd year Computer Science And Engineering M.N.N.I.T 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.