Re: [algogeeks] Minimal number of swaps
1 - keep a running total of the sum in an array (or reuse the same array) 2 - a[n - 1] (ie, the length of the array) - a[a[n - 1] - 1] is the answer 0 1 0 1 1 1 0 0 1 1 2 3 4 4 ans = 4 - a [ 4 - 1 ] = 2 1 0 1 0 1 1 1 2 2 3 ans = 3 - a [ 3 - 1 ] = 1 Same Os as the prev solution mentioned, except that the second pass isnt required. On Tue, Mar 29, 2016 at 12:29 PM, Régis Bacra <fredericdesmoul...@gmail.com> wrote: > Clever. Thanks! > > Le mardi 29 mars 2016 20:23:22 UTC+2, kumar raja a écrit : >> >> Adding time and space complexities. >> >> Time complexity: O(n) >> Space complexity: O(1) >> >> >> On 29 March 2016 at 23:44, kumar raja <rajkuma...@gmail.com> wrote: >> >>> I think it is straight forward. Correct me if i am wrong or if there is >>> better solution. >>> >>> 1) Do one pass over the list of elements and count the number of 1's. >>> let us say it is K >>> 2) count = 0 >>> from index 0 to K-1 do >>> if array[index] != 1 >>> count ++ >>> end >>> end >>> >>> The variable "count" indicates the minimum number of steps required to >>> obtain a sorted list. >>> >>> >>> On 29 March 2016 at 19:30, Régis Bacra <fredericd...@gmail.com> wrote: >>> >>>> This puzzle comes from a contribution on codingame.com (link to the >>>> puzzle <https://www.codingame.com/games/community/?puzzleId=103>). Any >>>> idea to solve it efficiently? >>>> >>>> Given a list of 1 and 0, you must regroup all the 1 at the begin of the >>>> list in a minimum number of steps. A step is the interchange of two >>>> elements located at different positions. >>>> The expected result is the minimum number of steps required to obtain a >>>> sorted list. >>>> >>>> Examples: >>>> 1 0 1 0 1 -> 1 >>>> 0 1 0 1 1 1 0 -> 2 >>>> >>>> -- >>>> You received this message because you are subscribed to the Google >>>> Groups "Algorithm Geeks" group. >>>> To unsubscribe from this group and stop receiving emails from it, send >>>> an email to algogeeks+...@googlegroups.com. >>>> >>> >>> >>> >>> -- >>> Regards >>> Kumar Raja >>> >>> >>> >> >> >> -- >> Regards >> Kumar Raja >> >> >> -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to algogeeks+unsubscr...@googlegroups.com. > -- Regards, Shachindra A C -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To unsubscribe from this group and stop receiving emails from it, send an email to algogeeks+unsubscr...@googlegroups.com.
Re: [algogeeks] Openings in Mentor Graphics,Noida Location
gj admin. Here's a question : http://careercup.com/question?id=5720992639877120 On Mon, Nov 16, 2015 at 8:38 PM, saurabh singh <saurab...@gmail.com> wrote: > Banned for spamming. > Again a request to the members to post algorithm related queries. Stuck in > some programming problem? Post it here. Not understanding some algorithm? > Post it here. Found an interesting problem? Post it. > > On Tue, Nov 17, 2015 at 10:04 AM Ashish kumar Jain <akjlucky4...@gmail.com> > wrote: > >> Anybody interested to join Mentor Graphics Noida having 1-10 years of >> experience in C/C++/DS/Algo can forward his/her resume to me. >> >> Please understand that the opening needs to be closed urgently.So,Hurry >> up. >> >> Note: Please ignore if inappropriate for this forum. >> >> >> -- >> Regards, >> Ashish >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Algorithm Geeks" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to algogeeks+unsubscr...@googlegroups.com. >> > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to algogeeks+unsubscr...@googlegroups.com. > -- Regards, Shachindra A C -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To unsubscribe from this group and stop receiving emails from it, send an email to algogeeks+unsubscr...@googlegroups.com.
Re: [algogeeks] Opening in Oracle IDC: Having experience in C/C++ 1.5 to 3 yr
You're not supposed to post job ads over here. Please help keeping the group clean. On Wed, Nov 11, 2015 at 7:55 PM, shashi kant <shashiski...@gmail.com> wrote: > hi, > > *Note:* if an inappropriate mail ..please do ignore > > Opening in Oracle IDC: Having experience in C/C++ 1.5 to 3 yr ..mail your > resume to me > > > > Regards, > *Shashi Kant * > *"Think positive and find fuel in failure"* > > *Senior Member technical Staff* > *Oracle India Pvt Ltd* > http://thinkndoawesome.blogspot.com/ > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to algogeeks+unsubscr...@googlegroups.com. > -- Regards, Shachindra A C -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To unsubscribe from this group and stop receiving emails from it, send an email to algogeeks+unsubscr...@googlegroups.com.
Re: [algogeeks] Re: [BANNED!!!] Urgent need Lead - Java Developer in Atlanta, GA
Well, you need to ban a whole lot more people. On Mon, Nov 2, 2015 at 10:16 AM, saurabh singh <saurab...@gmail.com> wrote: > FYI, have banned this user and several others who mistook this group for a > recruitment platform. Can we revive the legacy of this group again? > > > On Mon, Nov 2, 2015 at 11:36 PM Shaik Asif <shaik.deegi...@gmail.com> > wrote: > >> Hi Partner, >> >> This is Shaik from Deegit Inc. Partner find the below requirement for >> your consultants. If there are available. Please get back to me ASAP on >> sh...@deegit.com >> >> *WE ARE LOOKING FOR 10+ YEAR'S RESUME'S* >> >> *Position: Lead - Java Developer * >> >> Location: Atlanta, GA 30301 >> >> Duration: Long Term >> >> >> >> *Required skills: * >> >> · Experience in Unemployment Insurance >> >> · Core java, Spring MVC, SQL Transactions Annotations >> >> · experience with systems consulting, development and systems >> engineering in software projects technical design and development of Java >> based systems >> >> · Experience developing systems within the framework and >> governance of a well-defined Systems Engineering Life Cycle (SELC) >> >> · Experience in the role of systems consultant on projects of >> high complexity that typically have multiple concurrent and related >> activities >> >> · Delivery role handling complex Java projects >> >> · demonstrated technical experience with: >> >> · Java, JSP/Servlets, XML, >> >> · SOAP, Struts/Spring/Hibernate >> >> · Knowledge of Design Patterns, UML and Web Services. >> >> · Knowledge of Weblogic. >> >> · Understanding of SQL queries, Stored procedure, DB Design etc. >> >> · Knowledge of Junit Framework and Testing Techniques, >> Code-Coverage using java based tools like Eclipse >> >> Best Regards, >> >> ___ >> >> >> >> Shaik | Deegit Inc | >> >> 1900 East Golf Rd., Suite 925 | Schaumburg, IL 60173 | >> >> Ph: 847.440.2436 ext - 358 | Fax: 847.330.1987 >> >> sh...@deegit.com | www.deegit.com | >> >> >> >> “GSA Approved - GS-35F-0405V” >> >> "Certified Minority Business Enterprise (MBE)" >> >> "Winner - Deloitte Technology Fast 500 for 2008" >> >> "Winner - Inc. 5000 fastest growing firm for 2008" >> >> "Winner - Inc. 5000 fastest growing firm for 2009" >> >> >> >> "Right Person for the Right Job in the Right Time" >> >> >> >> The information transmitted is intended only for the person or entity to >> which it is addressed and may contain confidential and/or privileged >> material. Any review, retransmission, dissemination or other use of, or >> taking of any action in reliance upon, this information by persons or >> entities other than the intended recipient is prohibited. If you received >> this in error, please contact the sender and delete the material from any >> computer. >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Algorithm Geeks" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to algogeeks+unsubscr...@googlegroups.com. >> > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to algogeeks+unsubscr...@googlegroups.com. > -- Regards, Shachindra A C -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To unsubscribe from this group and stop receiving emails from it, send an email to algogeeks+unsubscr...@googlegroups.com.
Re: [algogeeks] Re: Openings in Flipkart BLR
Sadly, this has become no more than a job portal without any discussions on algorithms at all... ~Sac On Sun, Oct 4, 2015 at 10:18 PM, taruna arora <taruna1...@gmail.com> wrote: > Dear Sir, > > I am Taruna Arora working as Software Engineer with Indian Oil Corporation > Limited (PSU), Hire Date : 29th July, 2013. > > I came across your post today and wish to apply for the post of SDE1. > Sir,I know its pretty late but I am enclosing my resume for further > reference. > > Looking towards for opportunity from your side!!! > > > Regards & Thanks > Taruna Arora > > On Tuesday, 1 September 2015 21:38:43 UTC+5:30, Sachin Chitale wrote: > >> Hi folks, >> >> There are following open position in flipkart if someone is interested >> do send your resume. >> >> 1. SDE2/SDET 2/UI2 (2+ yrs) >> 2. APM/PM/EM >> 3. Engineering Directors >> 4. Architect >> 5. Data Scientist >> >> Regards, >> Sachin >> > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to algogeeks+unsubscr...@googlegroups.com. > -- Regards, Shachindra A C -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To unsubscribe from this group and stop receiving emails from it, send an email to algogeeks+unsubscr...@googlegroups.com.
Re: [algogeeks] Urgent Need Test Lead - Performance Engineer / Architect - Middleware in Atlan,GA for 6 months
please stop spamming in this group. On Fri, Sep 11, 2015 at 8:17 AM, Shaik Asif <shaik.deegi...@gmail.com> wrote: > Hi, > > > > This is Shaik from Deegit Inc. Please find the below requirement for your > review. If you are comfortable with the requirement please get back to me > ASAP. > > > > *Position: Test Lead - Performance Engineer / Architect - Middleware * > > Location: Atlanta, GA > > Duration: 6 months > > > > *Job Description:* > > · Demonstrate Teamwork & collaboration skills to work across > organizations and lead cross-functional teams > > · Experience with all phases of the Software Development > Lifecycle, including system analysis, design, coding, testing, debugging > and documentation > > · Problem solving skills to develop quick yet sound solutions to > resolve complex issues > > · Experience with WebSphere and/or Web logic Application Server > and its related components > > · Experience in installation, configuration, tuning , > troubleshooting, and administration of Web Logic and/or Web logic Server > > · Experience with Solaris/AIX/RHEL Operating Systems > > · Experience on TCP/IP, OSI, Routing, Firewall, DNS and other > Network related concepts. > > · Experience with IBM Data power appliance administration. > > · Experience with Oracle Webserver and/or IBM HTTP Server. This > includes installation, configuration, tuning , and troubleshooting > > · Supporting Coherence and IBM Extreme Scale caching solutions > > · Experience in supporting Java and J2EE applications deployed in > multi-site environment. > > · Experience in designing GSS and Load Balancer configurations to > support redundancy and failover for applications. > > · Experience installing, configuring, and tuning TIBCO BW, BE, > Active Spaces components > > · Experience with caching technologies like Oracle Coherence and > IBM WebSphere / TIBCO Extreme Scale. > > · Experience installing and configuring IBM WebSphere Message > Broker > > · Experience with scripting skills in Unix Shell, Perl, Python, > Jython > > · Experience on other middle ware products like Jboss,Tomcat > > · Experience working with Load balancing solutions like CSS, > Netscalers and F-5 > > · Experience working with monitoring tools like Wily Introscope, > HP Sitescope, Dynatrace etc. > > · Good time management, documentation and communication skills. > Must be able to interact with vendors. > > · Enthusiasm and eagerness to learn and embrace new technologies > > · Strong debugging skills to address issues ranging from > Hardware, OS, Middleware, and Network > > · Proven expertise in designing and building high performance, > scalable middleware and server side components and frameworks > > · Extensive experience in object oriented design and development > techniques > > · Strong trouble shooting and problem solving skills > > · Good understanding of algorithms, data structures and > performance optimization techniques > > · Proven track record of building scalable and reliable services > on Cloud > > > > *Skills Required* > > · Core Java, C/C++, Javascript, JSON, XML > > · Jquery, Spring, Struts, Hibernate, iBatis, Node.js > > · Web Services - REST, Web Security > > · WebSphere, MQs, TIBCO BW, Active Spaces > > · mySQL, Memcache/Redis, Cassandra/Hbase, MongoDB/CouchDB > > · Map Reduce, Hadoop, Hive, Mah out, > > · Fast Data Processing Storm > > · Rules Engine Drools > > > Best Regards, > > ___ > > > > Shaik | Deegit Inc | > > 1900 East Golf Rd., Suite 925 | Schaumburg, IL 60173 | > > Ph: 847.440.2436 ext - 358 | Fax: 847.330.1987 > > sh...@deegit.com | www.deegit.com | > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to algogeeks+unsubscr...@googlegroups.com. > -- Regards, Shachindra A C -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To unsubscribe from this group and stop receiving emails from it, send an email to algogeeks+unsubscr...@googlegroups.com.
Re: [algogeeks] Urgent Need Test Lead - Performance Architect in Atlanta, GA for 6 months
Admin, please kick out people who post ads here. On Tue, Sep 8, 2015 at 7:10 PM, Rahul <raikra...@gmail.com> wrote: > people aren't discussing algorithms either , like they used to in 2011 > > On 9/9/15, Shachindra A C <sachindr...@gmail.com> wrote: > > Hi all, > > > > Can we please limit this group to discussion on algorithms and not post > > jobs over here? This is becoming a nuisance with all job ads posted. > > > > > > On Tue, Sep 8, 2015 at 7:11 AM, Shaik Asif <shaik.deegi...@gmail.com> > > wrote: > > > >> Hi Partner, > >> > >> > >> > >> This is Shaik from Deegit Inc. Please find the below requirement for > your > >> review. If you are comfortable with the requirement please get back to > me > >> ASAP on sh...@deegit.com > >> > >> > >> > >> *Position: Test Lead - Performance Architect* > >> > >> Location: Atlanta, GA > >> > >> Duration: 6 Months > >> > >> > >> > >> · Performance Engineering of large transaction processing > systems > >> > >> · Performance Modeling & Optimization of Solution Architectures > >> > >> · End tend systems performance analysis and performance tuning, > >> in one or more of the following technologies : J2EE (Weblogic, > Websphere, > >> JBOSS), .NET, Oracle , SAP > >> > >> · Code Optimization and Platform Tuning in any of the above > >> technologies > >> > >> · Proficiency in Performance Testing, profiling and monitoring > >> tools (Certification in one or more of the following toolsets is > >> desirable) > >> > >> · HP LoadRunner > >> > >> · HP Performance Center > >> > >> · HP BAC, Diagnostics > >> > >> · HP Sitescope > >> > >> · CA Wily Introscope and CEM (APM) > >> > >> · SAR, vmstat, iostat, netstat, perfmon > >> > >> · CA Hyperformix > >> > >> · CA LISA (formerly called ITKLISA) > >> > >> · Building Performance Engineering Strategies for clients > >> > >> · Performance Testing (load, stress, volume, availability, > etc.), > >> Regression, manual and automated testing of web based and client-server > >> systems > >> > >> · End-to-end phases of performance testing, including > >> > >> · Performance Requirements Definition > >> > >> · Test Planning & Scheduling > >> > >> · Test Environment Planning > >> > >> · Defining performance metrics tbe captured across system and > >> application tiers, using profiling & monitoring tools > >> > >> · Building performance test scripts > >> > >> · Performance test execution > >> > >> · End tend bottleneck analysis > >> > >> · Defining performance tuning measures end-to-end, across all > >> tiers of applications being performance tested > >> > >> · Analysis of test data tidentify impact on release > >> > >> · Root cause analysis / diagnosis of performance issues that > >> occur on production systems > >> > >> · Defect Tracking and documentation > >> > >> · Capacity Planning > >> > >> Best Regards, > >> > >> ___ > >> > >> > >> > >> Shaik | Deegit Inc | > >> > >> 1900 East Golf Rd., Suite 925 | Schaumburg, IL 60173 | > >> > >> Ph: 847.440.2436 ext - 358 | Fax: 847.330.1987 > >> > >> sh...@deegit.com | www.deegit.com | > >> > >> -- > >> You received this message because you are subscribed to the Google > Groups > >> "Algorithm Geeks" group. > >> To unsubscribe from this group and stop receiving emails from it, send > an > >> email to algogeeks+unsubscr...@googlegroups.com. > >> > > > > > > > > -- > > Regards, > > Shachindra A C > > > > -- > > You received this message because you are subscribed to the Google Groups > > "Algorithm Geeks" group. > > To unsubscribe from this group and stop receiving emails from it, send an > > email to algogeeks+unsubscr...@googlegroups.com. > > > > > -- > > > > > > Regards > > Rahul Rai > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to algogeeks+unsubscr...@googlegroups.com. > -- Regards, Shachindra A C -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To unsubscribe from this group and stop receiving emails from it, send an email to algogeeks+unsubscr...@googlegroups.com.
Re: [algogeeks] Urgent Need ITIL Service Management Operations Business/Process Analyst in Manhattan, NY for 6+ months
^^ +1 On Wed, Sep 9, 2015 at 12:54 PM, Rahul Vatsa <vatsa.ra...@gmail.com> wrote: > Please block this guy. > > On Thu, Sep 10, 2015 at 1:08 AM, Shaik Asif <shaik.deegi...@gmail.com> > wrote: > >> Hi Partner, >> >> >> >> This is Shaik from Deegit Inc. Please find the below requirement for your >> review. If you are comfortable with the requirement please get back to me >> ASAP on sh...@deegit.com >> >> >> >> *Position: ITIL Service Management Operations Business/Process Analyst* >> >> Location: Manhattan, NY 10001 >> >> Duration: 6+ Months >> >> >> >> ITIL v3 Foundations or higher certification required >> >> · Experience with BMC Remedy required >> >> · Experience with ServiceNow beneficial >> >> · Able to understand and document complex IT processes >> >> · Experience performing IT assessments and preparing gap >> analysis documents and recommendations >> >> · Experience working as an analyst in support of IT technical >> operations (e.g. - service desk, desktop support, server and application >> management) >> >> · Very strong communication: verbal and written required. Able >> to facilitate workshops and meetings: drive agendas, document findings and >> next steps >> >> >> Best Regards, >> >> ___ >> >> >> >> Shaik | Deegit Inc | >> >> 1900 East Golf Rd., Suite 925 | Schaumburg, IL 60173 | >> >> Ph: 847.440.2436 ext - 358 | Fax: 847.330.1987 >> >> sh...@deegit.com | www.deegit.com | >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Algorithm Geeks" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to algogeeks+unsubscr...@googlegroups.com. >> > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to algogeeks+unsubscr...@googlegroups.com. > -- Regards, Shachindra A C -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To unsubscribe from this group and stop receiving emails from it, send an email to algogeeks+unsubscr...@googlegroups.com.
Re: [algogeeks] Urgent Need Test Lead - Performance Architect in Atlanta, GA for 6 months
Hi all, Can we please limit this group to discussion on algorithms and not post jobs over here? This is becoming a nuisance with all job ads posted. On Tue, Sep 8, 2015 at 7:11 AM, Shaik Asif <shaik.deegi...@gmail.com> wrote: > Hi Partner, > > > > This is Shaik from Deegit Inc. Please find the below requirement for your > review. If you are comfortable with the requirement please get back to me > ASAP on sh...@deegit.com > > > > *Position: Test Lead - Performance Architect* > > Location: Atlanta, GA > > Duration: 6 Months > > > > · Performance Engineering of large transaction processing systems > > · Performance Modeling & Optimization of Solution Architectures > > · End tend systems performance analysis and performance tuning, > in one or more of the following technologies : J2EE (Weblogic, Websphere, > JBOSS), .NET, Oracle , SAP > > · Code Optimization and Platform Tuning in any of the above > technologies > > · Proficiency in Performance Testing, profiling and monitoring > tools (Certification in one or more of the following toolsets is desirable) > > · HP LoadRunner > > · HP Performance Center > > · HP BAC, Diagnostics > > · HP Sitescope > > · CA Wily Introscope and CEM (APM) > > · SAR, vmstat, iostat, netstat, perfmon > > · CA Hyperformix > > · CA LISA (formerly called ITKLISA) > > · Building Performance Engineering Strategies for clients > > · Performance Testing (load, stress, volume, availability, etc.), > Regression, manual and automated testing of web based and client-server > systems > > · End-to-end phases of performance testing, including > > · Performance Requirements Definition > > · Test Planning & Scheduling > > · Test Environment Planning > > · Defining performance metrics tbe captured across system and > application tiers, using profiling & monitoring tools > > · Building performance test scripts > > · Performance test execution > > · End tend bottleneck analysis > > · Defining performance tuning measures end-to-end, across all > tiers of applications being performance tested > > · Analysis of test data tidentify impact on release > > · Root cause analysis / diagnosis of performance issues that > occur on production systems > > · Defect Tracking and documentation > > · Capacity Planning > > Best Regards, > > ___ > > > > Shaik | Deegit Inc | > > 1900 East Golf Rd., Suite 925 | Schaumburg, IL 60173 | > > Ph: 847.440.2436 ext - 358 | Fax: 847.330.1987 > > sh...@deegit.com | www.deegit.com | > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to algogeeks+unsubscr...@googlegroups.com. > -- Regards, Shachindra A C -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To unsubscribe from this group and stop receiving emails from it, send an email to algogeeks+unsubscr...@googlegroups.com.
Re: [algogeeks] Openings in Adobe India !!!
+1 for Shashwat. Kindly refrain from posting jobs here. There would be other groups for that. On Tue, Oct 14, 2014 at 2:01 AM, Shashwat Anand m...@shashwat.me wrote: People seems to confuse algogeeks with job board. No idea, how can we get rid of these spam. On Tue, Oct 14, 2014 at 2:25 PM, Ashish Mehta mehta.ashis...@gmail.com wrote: There are multiple openings in Adobe India for Developer position. Send me your resume ASAP. Here is the list of urgent openings. - · 31639_Member of Technical Staff / Computer Scientist https://workspaces.acrobat.com/?d=fYIUCfXMqBAaj0T8JrUMKA ·31497_Member of Technical Staff / Computer Scientist https://workspaces.acrobat.com/?d=U5lgab7ocxgSbz0CjInfyw ·26279_ Member of Technical Staff / Computer Scientist https://workspaces.acrobat.com/?d=hgTkxxHjX-jEcKNXOpxJBw ·30965_Member of Technical Staff / Computer Scientist https://workspaces.acrobat.com/?d=H7s2s7lpI3YK*RhWvOrU*Q ·31344_Member of Technical Staff / Computer Scientist https://workspaces.acrobat.com/?d=z6oIOM05vEdN6aZ76w1NXg ·30759_Member of Technical Staff / Computer Scientist https://workspaces.acrobat.com/?d=iYfB3oGLK*cP-GdYbRYqRA ·32543_Member of Technical Staff / Computer Scientist https://workspaces.acrobat.com/?d=DQ-WKuGH8byLQ9Z5p8vWWQ ·27526_Security Czar https://workspaces.acrobat.com/?d=2lXPky*D8qGxQbm9KDHdIw ·30262_Member of Technical Staff / Computer Scientist - MAC Developer https://workspaces.acrobat.com/?d=8MDJ3-8PpjXLwSN8sZe2lQ ·30976 Member of Technical Staff / Computer Scientist https://workspaces.acrobat.com/?d=AzpXN7cZ1Zh9l1usUsUMEQ Conditions for freshers: - Candidate should be from a premier college i.e. IIT/IIIT/NIT/BITS or equivalent. - In case of any college from where Adobe does not hire developers. I would recommend that you have something concrete in your resume so that I can talk to HR with confidence. :) Do mention this in the mail. Regards, Ashish -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To unsubscribe from this group and stop receiving emails from it, send an email to algogeeks+unsubscr...@googlegroups.com. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To unsubscribe from this group and stop receiving emails from it, send an email to algogeeks+unsubscr...@googlegroups.com. -- Regards, Shachindra A C -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To unsubscribe from this group and stop receiving emails from it, send an email to algogeeks+unsubscr...@googlegroups.com.
Re: [algogeeks] Re: Amazon interview question
Consider n = 5. Naming the array elements as a1,a2,a3,a4,a5 , the final required sum would be 4C0 * a5 - 4C1 * a4 + 4C2 * a3 - 4C3 * a2 + a1. That is nothing but the pattern of a binomial expansion. Using this method, the complexity can be reduced to O(n). Correct me if I'm wrong! On Tue, Apr 9, 2013 at 1:51 PM, Shashwat Kumar shashwatkmr@gmail.comwrote: Recursion and iteration don't differ in this algorithm. But avoid using recursion if same can be done using iteration. In practical cases, system does not allow very large depth in recursion. So for large values of n, there can occur segmentation fault. On Tue, Apr 9, 2013 at 11:43 AM, rahul sharma rahul23111...@gmail.comwrote: If you have any other solution ..please post that...i thnik recursion is ok with base case...we need to scan again after first iteration...?? On Wed, Apr 10, 2013 at 12:12 AM, rahul sharma rahul23111...@gmail.comwrote: i forgot to add base case..can add wen 2 elemnts are there then there sum is stored and we reurn from there...i m in hurry,,,sry for that,, On Wed, Apr 10, 2013 at 12:11 AM, Don dondod...@gmail.com wrote: It is O(N^2) because the inner loop takes N steps to execute and that loop will be executed N times. However, I would suggest not using recursion. There is no reason to not do it iteratively. Your recursive solution has no base case so it will recurse until your computer runs out of stack space, at which point it will crash. Don On Apr 9, 2:29 pm, rahul sharma rahul23111...@gmail.com wrote: A = {5, 3, 8, 9, 16} After one iteration A = {3-5,8-3,9-8,16-9}={-2,5,1,7} After second iteration A = {5-(-2),1-5,7-1} sum =7+(-4)+6=9 Given an array, return sum after n iterations my sol/ void abc(int arr[],n) { for(i=0;in;i++) arr[i]=arr[i+1]-arr[i]; abc(arr,n-1); } I wana ask that the complexity is o(n) or o(n)2..as loop is executed n times..say n is 10...so fxn is called 10 timesi.e 10 n..and ignoring n it comes out to be...n..but if we implemeted with 2 loops then complexity is n2 ...and both sol are taking same no of iterations...please tell whether complexity is n or n2 for above codeif it is n2 then how??? -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To unsubscribe from this group and stop receiving emails from it, send an email to algogeeks+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To unsubscribe from this group and stop receiving emails from it, send an email to algogeeks+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- Shashwat Kumar Third year Undergraduate student Department of Computer Science and Engineering IIT Kharagpur -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To unsubscribe from this group and stop receiving emails from it, send an email to algogeeks+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- Regards, Shachindra A C -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To unsubscribe from this group and stop receiving emails from it, send an email to algogeeks+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[algogeeks] find out all pairs of numbers a,b such that a^2+b^2 = N
Hi Guys, Came across this interesting question : Given an integer N, find out all pairs of numbers a,b such that a^2+b^2 = N. My approach is to find the floor of square root of N, and then try all possible combinations from 1 to sqrt(N). Just wonder if I can do anything better in the complex space ie, by expressing a^2+b^2 = (a + ib)(a - ib). Any ideas or suggestions for better approaches? -- Regards, Shachindra A C -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To unsubscribe from this group and stop receiving emails from it, send an email to algogeeks+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [algogeeks] find out all pairs of numbers a,b such that a^2+b^2 = N
Guneesh, Thanks for the reply. I interpret ur answer as follows: If N = say, 50 the two combinations are (1,7) and (5,5). Acc to you, first find sqrt(50) = 7 fill in 1,4,9,16,25,36,49 in an array. Then have min = 0, max = 6 and get all combinations in one pass over the array, right? So, the complexity would be O(n^0.5), right? Can you think of any solution making use of complex domain? Just curious to know... On Wed, Feb 13, 2013 at 10:28 PM, Guneesh Paul Singh gunees...@gmail.comwrote: Replace all elements of array by its square.and sort it Now question is to find two nos in the array such that their sum is N. For this take two pointers min and max Initialize min to 0 and max to n-1(n-size of array) 1.find the sum a[min]+a[max] 2.if sumN max=max-1 if sumN min=min+1 if sum==N we have a sol Now in case of nonunique values all possible pairs must be displayed eg for 2 2 3 3 N =5 min=0,max 3 is a sol but u need to display all combination of 2 and 3 for that i used tempmin=position till which we have a value a[min] and temp max postion till which we have a value a[max] and display all possible combinations. P.S. This was asked to me in Amazon -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To unsubscribe from this group and stop receiving emails from it, send an email to algogeeks+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- Regards, Shachindra A C -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To unsubscribe from this group and stop receiving emails from it, send an email to algogeeks+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[algogeeks] codechef mixtures problem
Hi All, Can someone explain the below problem's solution : http://www.codechef.com/problems/MIXTURES I have been struggling to solve DP problems and am not able to think clearly in problems like the one mentioned. Kindly help me to understand DP by providing some useful links. -- Regards, Shachindra A C -- 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] plz xplain the o/p
I assume you expect to see the strings interchanged. But you are not changing anything in the memory. So in main(), pstr[0] and pstr[1] contains whatever was there earlier. If you change the parameters of the swap to swap(char **,char **), pass the addresses of pstr[0] ,pstr[1] and then do whatever u r doing in swap, the strings will get exchanged. On Wed, Sep 7, 2011 at 11:26 AM, piyush agarwal pshagl...@gmail.com wrote: #includestdio.hvoid swap(char *, char *); int main() { char *pstr[2] = {Hello, piyush}; swap(pstr[0], pstr[1]); printf(%s\n%s, pstr[0], pstr[1]); return 0; }void swap(char *t1, char *t2) { char *t; t=t1; t1=t2; t2=t; } -- Piyush Agarwal Final Year Undergraduate Department of Computer Engineering Malaviya National Institute of Technology 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. -- Regards, Shachindra A C -- 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] urgent C o/p
got to do with the internal representation of various types. i think. For eg, float is composed of a mantissa, exponent etc. So if u try to print a floating point as an int, you'll get unpredictable outputs. On Mon, Sep 5, 2011 at 1:36 PM, Aman Kumar amanas...@gmail.com wrote: #includestdio.h int main() { float a=3.2; printf(%d\n\n,a);//line 1 printf(%d,*(int *)a); //line 2 } o/p(gcc comppiler) = -1610612736 1078774989 i am not getting why and how these /p r coming . what is difference between line 1 and line 2? reply asap -- 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. -- Regards, Shachindra A C -- 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] How to design snake and ladder game using OOPS
For chess programming, I found this site very useful. The code, though, is not object oriented(excuse me for that). Nevertheless, its a good place to learn chess programming. http://www.tckerrigan.com/Chess/TSCP On Wed, Aug 17, 2011 at 5:59 PM, mayur mayursa...@gmail.com wrote: Hi can any one help me, in how to answer these type of questions. Like how do you design Snake and Ladder game, or a Chess Game. What classes you will use, which methods and variables will be private/ public. Its not about coding, its about designing. Please Help -- 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. -- Regards, Shachindra A C -- 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: Probability Puzzle
@dave : nice explanationsthank you for pointing out :) On Wed, Aug 10, 2011 at 3:39 AM, Prakash D cegprak...@gmail.com wrote: @dave: thank you.. nice explanation :) On Wed, Aug 10, 2011 at 3:24 AM, Dave dave_and_da...@juno.com wrote: @Ritu: We are flipping one coin five times. Are you saying that you don't learn anything about the coin by flipping it? Would you learn something if any one of the five flips turned up tails? After a tails, would you say that the probability of a subsequent head is still 3/5? Dave On Aug 9, 11:19 am, ritu ritugarg.c...@gmail.com wrote: The statement You randomly pulled one coin from the bag and tossed tells that all the events of tossing the coin are independent hence ans is 3/5 On Aug 7, 10:34 pm, Algo Lover algolear...@gmail.com wrote: A bag contains 5 coins. Four of them are fair and one has heads on both sides. You randomly pulled one coin from the bag and tossed it 5 times, heads turned up all five times. What is the probability that you toss next time, heads turns up. (All this time you don't know you were tossing a fair coin or not). -- 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. -- Regards, Shachindra A C -- 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: amazon question
At the point of execution of the 4th fork(), there are 8 processes i.e, the 4th fork will get executed 8 times. The final value of ret will depend on this fork. the fork will return 0 in the 8 child processes created and returns pid of the child in the parent processes. On Mon, Aug 8, 2011 at 12:49 PM, Kamakshii Aggarwal kamakshi...@gmail.comwrote: then please elaborate? On Mon, Aug 8, 2011 at 12:34 PM, Pradex pradam.prad...@gmail.com wrote: get it..!! :) :) On Aug 7, 10:49 pm, Shachindra A C sachindr...@gmail.com wrote: 8 one's and 8 two's. The order in which they get printed might vary. On Mon, Aug 8, 2011 at 11:11 AM, Kamakshii Aggarwal kamakshi...@gmail.comwrote: what will be the o/p of the following program: main() { int ret; ret=fork(); ret=fork(); ret=fork(); ret=fork(); if(!ret) printf(one); else printf(two); } -- Regards, Kamakshi kamakshi...@gmail.com -- 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. -- Regards, Shachindra A C -- 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. -- Regards, Kamakshi kamakshi...@gmail.com -- 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. -- Regards, Shachindra A C -- 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: Probability Puzzle
@brijesh *first five times* is mentioned intentionally to mislead i think. I vote for 3/5. Moreover, 17/80 doesn't make sense also. Plz correct me if I am wrong. On Mon, Aug 8, 2011 at 12:06 PM, sumit gaur sumitgau...@gmail.com wrote: (3/5) On Aug 7, 10:34 pm, Algo Lover algolear...@gmail.com wrote: A bag contains 5 coins. Four of them are fair and one has heads on both sides. You randomly pulled one coin from the bag and tossed it 5 times, heads turned up all five times. What is the probability that you toss next time, heads turns up. (All this time you don't know you were tossing a fair coin or not). -- 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. -- Regards, Shachindra A C -- 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: puzzle
tie the rope to the peg and hold the rope at a little less than 100m point. Then jump. On Mon, Aug 8, 2011 at 1:19 PM, Himanshu Srivastava himanshusri...@gmail.com wrote: @Dave oh i thought some logical concept willl be applied in that case...it is ok!!! thanks:) On Fri, Aug 5, 2011 at 1:47 AM, Dave dave_and_da...@juno.com wrote: @Himanshu: That is easy for any boy scout. :-) Tie the rope at the top of the tower. Then tie a sheepshank knot of a comfortable length in the rope and cut the middle strand inside the knot. Climb down the rope to the peg and tie the other end of the rope onto the peg. Then, while standing on or hanging from the peg, shake the upper rope to release the sheepshank knot. The upper end will fall down and you can climb the rest of the way down. Dave On Aug 4, 1:50 pm, Himanshu Srivastava himanshusri...@gmail.com wrote: suppose u tie the rope at 200mt height and now climb down to 100m heightthen u tie the rope at that point then how will you open the rope at point above 200mt where u have tied it earlier On Thu, Aug 4, 2011 at 11:15 PM, mohit verma mohit89m...@gmail.com wrote: can't we tie the rope where we are standing (at height of 200 meter)? On Thu, Aug 4, 2011 at 10:26 PM, neeraja marathe neeraja.marath...@gmail.com wrote: this was the puzzle asked to me in NVIDIA interview: you are standing on top of a tower of ht 200 mt. .At 100 mt. ht . from bottom of tower there is a peg where u can tie a rope. You have a rope of length 150 mt. with you and using this rope you have to get down the tower. you can not jump or there is nobody to help you. how will u get down the tower?? -- 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. -- *MOHIT VERMA* -- 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.- Hide quoted text - - Show quoted text - -- 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. -- Regards, Shachindra A C -- 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] o/p
the statement will be transformed to : m=3+(23)?2:3; n=2*(32)?3:2; which will become m = 3 + 0 ? 2 : 3; n = 2 * 1 ? 3 : 2; On Mon, Aug 8, 2011 at 3:46 PM, Kamakshii Aggarwal kamakshi...@gmail.comwrote: thanks..got it... On Mon, Aug 8, 2011 at 3:45 PM, jagrati verma jagrativermamn...@gmail.com wrote: #define max(a,b)((ab)?a:b) use parenthese thn it will giv the correct o/p On Mon, Aug 8, 2011 at 3:27 PM, Kamakshii Aggarwal kamakshi...@gmail.com wrote: #include stdio.h #define max(a,b)(ab)?a:b int main() { int m,n; m=3+max(2,3); n=2*max(3,2); printf(%d,%d,m,n); getchar(); return 0; } y the o/p is 2,3,,please explain -- Regards, Kamakshi kamakshi...@gmail.com -- 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. -- Regards, Kamakshi kamakshi...@gmail.com -- 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. -- Regards, Shachindra A C -- 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] o/p
@raj, the preprocessed file would contain m=3+(23)?2:3 AFAIK. So, the statement would evaluate to 3 + 1 ? 2 : 3 == 4 ? 2 : 3 == m = 2. Likewise for n. On Mon, Aug 8, 2011 at 5:21 PM, raj kumar megamonste...@gmail.com wrote: 3+23?2:3 so 53 hence 2 is returned bcoz of higher precedence of + over ? Thanks -- 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. -- Regards, Shachindra A C -- 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] o/p
oops...I'm sorry.. the statement would evaluate to 3 + *0* ? 2 : 3 == *3* ? 2 : 3 == m = 2. On Mon, Aug 8, 2011 at 5:43 PM, Shachindra A C sachindr...@gmail.comwrote: @raj, the preprocessed file would contain m=3+(23)?2:3 AFAIK. So, the statement would evaluate to 3 + 1 ? 2 : 3 == 4 ? 2 : 3 == m = 2. Likewise for n. On Mon, Aug 8, 2011 at 5:21 PM, raj kumar megamonste...@gmail.comwrote: 3+23?2:3 so 53 hence 2 is returned bcoz of higher precedence of + over ? Thanks -- 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. -- Regards, Shachindra A C -- Regards, Shachindra A C -- 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: amazon test question!!!
deletes the tree from bottom to top On Tue, Aug 9, 2011 at 10:30 AM, programming love love.for.programm...@gmail.com wrote: delete function will set parent-left_leaf=null and parent-right_leaf=null as a part of it's function. So after deletion of leaf nodes, the call returns to the parent nodes which are the current leaf nodes. Hence the option must be *deletion of the tree from bottom to top*. -- 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. -- Regards, Shachindra A C -- 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] amazon question
8 one's and 8 two's. The order in which they get printed might vary. On Mon, Aug 8, 2011 at 11:11 AM, Kamakshii Aggarwal kamakshi...@gmail.comwrote: what will be the o/p of the following program: main() { int ret; ret=fork(); ret=fork(); ret=fork(); ret=fork(); if(!ret) printf(one); else printf(two); } -- Regards, Kamakshi kamakshi...@gmail.com -- 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. -- Regards, Shachindra A C -- 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] C++ doubt
Hi All, In the code below, even though pD is actually pointing to a base class object, how is the print function being successfully called? #includeiostream class base { public: int BVal; base() { BVal = 100; } }; class derived : public base { public: derived() { DVal = 500; } void print() { std::cout\nBVal =BValstd::endlDVal = DValstd::endl; } int DVal; }; int main() { base B; derived D; derived *pD; *pD = static_castderived*(B);* *pD-print();* return 0; } -- Regards, Shachindra A C -- 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] Puzzle
Calibrate both the ropes and burn 1 rope from both ends. It will take half an hour. Then note down the point where the rope fully burns out. Cut the second rope at this point and fire both ends of any one of the pieces. This will take 15 mins. On Thu, Aug 4, 2011 at 4:54 PM, anubhav gupta anubhav.7...@gmail.comwrote: both ropes have to burn in one hour.. so if burn first rope at both ends it wil definitely take 30 mins to burn completely no matter how non uniform burning is.. when first rope burn out completly(after 30 mins) second rope still have 30 mins left for complete burning so if it is burn at both ends it wil take half the time left i.e 15 mins .. so in total we get 45 mins On Thu, Aug 4, 2011 at 4:32 PM, Nikhil Gupta nikhilgupta2...@gmail.comwrote: @priyanka, the ropes have a non uniform rate of burning. Means at some duration they will be burning faster, and slower at some. So you cannot say that first rope will take 30mins to burn completely, and by that time second rope is half burnt. Nikhil Gupta -- 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. -- Regards, Shachindra A C -- 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: C++ doubt
Hi Amit, Thanks for your reply. I digged out google and found out that this kind of conversion(downcasting from base class to derived class) can lead to unexpected behaviour. However, I fail to understand how the print function was actually called inspite of it not being in the base class. I would have expected a run time error saying that the print() function was not found. Maybe the assembly code might have the answer for that. On Fri, Aug 5, 2011 at 1:10 AM, Amit hiamit.r...@gmail.com wrote: static_cast does not do run time type checking. That's why base class pointer can be changed to drived class though it actually is a base class pointer. Now its a drived class pointer, you can call drived class functions. If you use dynamic_cast instead of static_cast, it will throw a bad cast exception, because dynamic_cast does runtime type checking. Regards, Amit -- 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. -- Regards, Shachindra A C -- 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] Amazon telephonic question
@Ankit Can you please explain the method to get the answer to the second subpart of your solution in O(n) time? My solution to solve the problem in O(n log(n)) time is as follows: Insert the nodes of the sorted array into a binary tree. Then start with the first node. Subtract the value of the node from X. Then search for the result of the subtraction in the binary tree. This can be done in O(log n) time, giving O(nlogn) for the overall complexity of the second subproblem. Please explain your logic. On Tue, Jun 28, 2011 at 5:48 PM, Nitish Garg nitishgarg1...@gmail.comwrote: Can you please explain how to solve the 2nd question? -- 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/-/5C-1NnideVgJ. 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, Shachindra A C -- 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] Amazon telephonic question
@ankit : I'm pretty confident that the second part of your solution cannot be done in O(n) time. Correct me if I am wrong!! Nevertheless, the overall time complexity remains O(n*log(n)), as you pointed out. On Tue, Jun 28, 2011 at 5:59 PM, Shachindra A C sachindr...@gmail.comwrote: @Ankit Can you please explain the method to get the answer to the second subpart of your solution in O(n) time? My solution to solve the problem in O(n log(n)) time is as follows: Insert the nodes of the sorted array into a binary tree. Then start with the first node. Subtract the value of the node from X. Then search for the result of the subtraction in the binary tree. This can be done in O(log n) time, giving O(nlogn) for the overall complexity of the second subproblem. Please explain your logic. On Tue, Jun 28, 2011 at 5:48 PM, Nitish Garg nitishgarg1...@gmail.comwrote: Can you please explain how to solve the 2nd question? -- 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/-/5C-1NnideVgJ. 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, Shachindra A C -- Regards, Shachindra A C -- 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] Amazon telephonic question
@ankit,sunny : thanks for the explanation. I got it. On Wed, Jun 29, 2011 at 10:16 AM, Ashish Goel ashg...@gmail.com wrote: pointer to next smallest will not lead to constant time operation Best Regards Ashish Goel Think positive and find fuel in failure +919985813081 +919966006652 On Tue, Jun 28, 2011 at 3:19 PM, Anurag Sharma anuragvic...@gmail.comwrote: for second problem, you can create a stack of having each element as a node having the current value as well as pointer to the next smallest value present below it. This can solve all 3 operations in constant time. Thanks, Anurag On Tue, Jun 28, 2011 at 3:00 PM, vikas mehta...@gmail.com wrote: 1.Given an array of integers and another integer X - create an algorithm to determine if the sum of any two integers in the array would result in x 2. design a ADT to implement push(), pop() method as stack, and also has a getMinElement(). Require that getMinElement() is constant time but push()/pop() do not have to be constant time at first. Then for improvement, these three methods are all required to be constant time -- 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/-/_meOQF9Qu1AJ. 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. -- Regards, Shachindra A C -- 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 ] Statement Riddle
+1 to shady's post. Please ban him. On Mon, Jun 27, 2011 at 5:32 PM, shady sinv...@gmail.com wrote: if moderators are alive, can they ban him ? On Mon, Jun 27, 2011 at 12:48 PM, Lavesh Rawat lavesh.ra...@gmail.comwrote: *Statement Riddle - 27 june * * * ** *'Ferari driver' easily beats the 'force indain driver' in a two care race.How did Indian newspapers * *truthfully report so to look as 'force indain drive' had outdone the 'ferari driver' Think ?? * *Update Your Answers at* : Click Herehttp://dailybrainteaser.blogspot.com/2011/06/statement-riddle.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. -- Regards, Shachindra A C -- 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] Please explain the output
#includestdio.h #define power(a) #a int main() { printf(%d,*power(432)); return 0; } the printf statement, after preprocessing, will look like printf(%d,*432); so, when u print the value at the first position of the string, 52, which is the ascii value of 4, will be printed. On Thu, Jun 23, 2011 at 3:40 PM, vaibhav shukla vaibhav200...@gmail.comwrote: #includestdio.h #define power(a) #a int main() { printf(%d,*power(432)); return 0; } ans is 52 on gcc. Explain plss -- best wishes!! Vaibhav Shukla DU-MCA -- 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. -- Regards, Shachindra A C -- 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 ] A Riddle
he was walking On Wed, Jun 22, 2011 at 12:38 PM, Vishal Thanki vishaltha...@gmail.comwrote: was he driving a bus or tram? On Wed, Jun 22, 2011 at 12:36 PM, Yameni Dhankar yamenid...@gmail.com wrote: was he driving an ambulance? On Wed, Jun 22, 2011 at 12:33 PM, Lavesh Rawat lavesh.ra...@gmail.com wrote: A Riddle A bus driver was heading down a street in Delhi. He went right past a stop sign without stopping, he turned left where there was a 'no left turn' sign and he went the wrong way on a one-way street. Then he went on the left side of the road past a cop car. Still - he didn't break any traffic laws. Why not? Update Your Answers at : Click Here 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. -- Yameni Dhankar Division of Computer Engineering(Undergraduate), Netaji Subhas Institute of Technology, New Delhi -- 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. -- Regards, Shachindra A C -- 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] OS
last year's gate question? On Tue, Jun 21, 2011 at 11:32 PM, Akshata Sharma akshatasharm...@gmail.comwrote: But, the OS maintains a separate PC (program counter ),stack and A CPU register state for a thread . So option A I am not sure is correct, it says ONLY.. scheduling and accounting information is stored for a process right? Can you please explain why C is not correct and D is correct? On Tue, Jun 21, 2011 at 11:17 PM, rahul rahulr...@gmail.com wrote: A, D On Tue, Jun 21, 2011 at 11:16 PM, Akshata Sharma akshatasharm...@gmail.com wrote: A thread is usually defined as a ‘light weight process’ because an operating system (OS) maintains smaller data structures for a thread than for a process. In relation to this, which of the followings is TRUE? (A) On per-thread basis, the OS maintains only CPU register state (B) The OS does not maintain a separate stack for each thread (C) On per-thread basis, the OS does not maintain virtual memory state (D) On per thread basis, the OS maintains only scheduling and accounting information -- 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. -- Regards, Shachindra A C -- 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] Find the error..
the only thing wrong about the program is the memory leak :p On Wed, Jun 22, 2011 at 4:30 PM, PRITPAL SINGH pritpal2...@gmail.comwrote: What do you expect it to give ? On Wed, Jun 22, 2011 at 4:25 PM, Balaji S balaji.ceg...@gmail.com wrote: What is the wrong in this program main() { char *p,*q; p=(char *)malloc(25); q=(char*) malloc(25); strcpy(p,INDIA ); strcpy(q,hyd); strcat(p,q); printf(%s,p); } -- With Regards, Balaji.S -- 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. -- Regards Pritpal Singh Banga (RIT2008021) BTech ( IT ) , 6th Semester, Indian Institute of Information Technology Allahabad - 211012, India Official email : rit2008...@iiita.ac.in rit2008...@iiita.ac.in Mobile: +91-9793907703 -- 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. -- Regards, Shachindra A C -- 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] Find the error..
@balaji, the memory allocated from the heap using malloc needs to be released before termination of the program. there should be two additional statements as follows: free(p); free(q); On Wed, Jun 22, 2011 at 6:09 PM, PRITPAL SINGH pritpal2...@gmail.comwrote: @balaji I think memory leak is the only problem with the code. rest is fine On Wed, Jun 22, 2011 at 6:03 PM, Balaji S balaji.ceg...@gmail.com wrote: @pritpal : Refer ques 5 at http://www.youthrocker.com/2011/06/interview-questions-amazon-placement.html @shachindra : wats tat :-o -- 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. -- Regards Pritpal Singh Banga (RIT2008021) BTech ( IT ) , 6th Semester, Indian Institute of Information Technology Allahabad - 211012, India Official email : rit2008...@iiita.ac.in rit2008...@iiita.ac.in Mobile: +91-9793907703 -- 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. -- Regards, Shachindra A C -- 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] Find the error..
As vishal pointed out, checking the return val is missing and it is the programmer's responsibility to free up the memory which he has requested for... On Wed, Jun 22, 2011 at 7:37 PM, ankit sambyal ankitsamb...@gmail.comwrote: @Vishal : Ya this seems to be correct.. On Wed, Jun 22, 2011 at 7:05 AM, ankit sambyal ankitsamb...@gmail.com wrote: @Balaji : the code given by u compiles and runs successfully in gcc compiler and gives the correct answer i.e. INDIAhyd . What's the problem ?? @Shachindra A C : Which memory leak are you talking about ?? The memory allocated from the heap using malloc need not be released before termination of the program. That's definitely not an error. The compiler does it automatically after the termination of the program... Correct me if I am wrong !! Regards, Ankit Sambyal BITS Pilani On Wed, Jun 22, 2011 at 6:34 AM, Shachindra A C sachindr...@gmail.com wrote: @balaji, the memory allocated from the heap using malloc needs to be released before termination of the program. there should be two additional statements as follows: free(p); free(q); On Wed, Jun 22, 2011 at 6:09 PM, PRITPAL SINGH pritpal2...@gmail.com wrote: @balaji I think memory leak is the only problem with the code. rest is fine On Wed, Jun 22, 2011 at 6:03 PM, Balaji S balaji.ceg...@gmail.com wrote: @pritpal : Refer ques 5 at http://www.youthrocker.com/2011/06/interview-questions-amazon-placement.html @shachindra : wats tat :-o -- 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. -- Regards Pritpal Singh Banga (RIT2008021) BTech ( IT ) , 6th Semester, Indian Institute of Information Technology Allahabad - 211012, India Official email : rit2008...@iiita.ac.in Mobile: +91-9793907703 -- 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. -- Regards, Shachindra A C -- 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. -- Regards, Shachindra A C -- 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: output....
change 1st line to i = 3 and execute. It will print 9. If i = 4, then the default case gets executed and then goes to case 3, then i's val will be 9. Later, it comes out of the switch block and prints the val as 9. On Mon, Jun 20, 2011 at 4:10 PM, oppilas . jatka.oppimi...@gmail.comwrote: Nick, I had just tested the code for confirming my doubt whether break statement takes the program counter outside of the first loop or not. int i = 4; switch (i) { default: ; case 3: i += 5; if ( i == 8){ i++; * if (i == 9) break; /* Now after executing this break should't the program counter go to priintf statement* */* and print 9* * * i *= 2; } i -= 4; break; case 8: i += 5; break; } printf(i = %d\n, i); } On Mon, Jun 20, 2011 at 1:30 PM, nicks crazy.logic.k...@gmail.com wrote: what's the problem...when t=6 the break statement gets executed and the control comes out of the for loop.. hence prints 6.. On Mon, Jun 20, 2011 at 12:05 AM, Oppilas jatka.oppimi...@gmail.comwrote: Sanjay, Whenever we encounter a break statement does not it means to take the program counter outside of the current loop. I am confused a little bit. Someone please clarify. See the following program #includestdio.h #includestdlib.h int main(){ int t=4; for(int i=0;i5;i++){ if(1){ if(t==6) break; } t++; } printf(%d,t); /* Prints 6 */ return 0; } ~ Oll On Jun 19, 6:05 pm, sanjay ahuja sanjayahuja.i...@gmail.com wrote: i=4 is default case for but there is no break statement after default case. There for all cases until break is encountered will be executed. so i += 5; makes i=9 i -= 4; will make i=5 and then break so i is 5 On Sun, Jun 19, 2011 at 6:29 PM, sahil sahil18...@gmail.com wrote: #includestdio.h void main() { int i = 4; switch (i) { default: ; case 3: i += 5; if ( i == 8) { i++; if (i == 9) break; i *= 2; } i -= 4; break; case 8: i += 5; break; } printf(i = %d\n, i); } output: i=5 how..? can sme one 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, visit this group athttp:// groups.google.com/group/algogeeks?hl=en. -- Sanjay Ahuja, Analyst, Financing Prime Brokerage Nomura Securities India Pvt. Ltd -- 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. -- Regards, Shachindra A C -- 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] preincrement and post increment
I didnt execute your code...but i think having a look at the assembly code produced could give a good insight into the actual working. On Mon, Jun 20, 2011 at 4:26 PM, himanshu kansal himanshukansal...@gmail.com wrote: int val; int *p=val; why does (++val)++ gives err in c bt nt in c++. i knw dt abv expression wd produce undefined results bt i just want to knw why its nt giving the err in c++ 2nd ques is whn ++val++ is invalid thn why ++*p++ is valid does it hv something to do wd references?? -- 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. -- Regards, Shachindra A C -- 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] preincrement and post increment
As far as I understand, this has got nothing to do with references and pls ignore my earlier post. On Mon, Jun 20, 2011 at 4:31 PM, Shachindra A C sachindr...@gmail.comwrote: I didnt execute your code...but i think having a look at the assembly code produced could give a good insight into the actual working. On Mon, Jun 20, 2011 at 4:26 PM, himanshu kansal himanshukansal...@gmail.com wrote: int val; int *p=val; why does (++val)++ gives err in c bt nt in c++. i knw dt abv expression wd produce undefined results bt i just want to knw why its nt giving the err in c++ 2nd ques is whn ++val++ is invalid thn why ++*p++ is valid does it hv something to do wd references?? -- 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. -- Regards, Shachindra A C -- Regards, Shachindra A C -- 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] kernel programming
Hi All, Can someone suggest me some good books to learn kernel programming in linux? -- Regards, Shachindra A C -- 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] kernel programming
thank you Douglas and Rahul.. On Mon, Jun 20, 2011 at 11:31 PM, rahul rahulr...@gmail.com wrote: read gorman. On Mon, Jun 20, 2011 at 10:27 PM, Douglas Diniz dgdi...@gmail.com wrote: Linux kernel development - 3th Edition - Robert Love On Mon, Jun 20, 2011 at 9:42 AM, Shachindra A C sachindr...@gmail.com wrote: Hi All, Can someone suggest me some good books to learn kernel programming in linux? -- Regards, Shachindra A C -- 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. -- --- Douglas Gameiro Diniz Engenheiro de Computação - 2003 - UNICAMP Mobile: (19) 92158777 Gtalk: dgdiniz Msn: thedougdi...@hotmail.com -- 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. -- Regards, Shachindra A C -- 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: is it correct??
@vipul : dynamic memory allocation from stack? are you sure? generally dynamic memory allocations are done from the heap right? On Wed, Jun 15, 2011 at 2:28 PM, kartik sachan kartik.sac...@gmail.comwrote: hey is itoa() is supported by g++ compliers??? -- 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. -- Regards, Shachindra A C -- 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] A simple C question
There can be some synchronisation problems with fork() right? say world might get printed first...or maybe the letters can get jumbled too...We cannot guarantee the order of execution unless we use semaphores. On Fri, Jun 3, 2011 at 12:14 PM, Naveen Kumar naveenkumarve...@gmail.comwrote: oh yes, gud one On Fri, Jun 3, 2011 at 12:12 PM, Vishal Thanki vishaltha...@gmail.comwrote: vishal@ubuntu:~/progs/c\ 12:11:53 PM $ cat fork.c #include stdio.h #include stdlib.h int main() { if (fork()) { printf(hello ); } else { printf(world\n); } return 0; } vishal@ubuntu:~/progs/c\ 12:11:56 PM $ gcc fork.c vishal@ubuntu:~/progs/c\ 12:12:06 PM $ ./a.out hello world On Fri, Jun 3, 2011 at 12:09 PM, Naveen Kumar naveenkumarve...@gmail.com wrote: Hi Vishal, Can you show us how it be done with fork? On Fri, Jun 3, 2011 at 12:02 PM, Vishal Thanki vishaltha...@gmail.com wrote: can use fork() also.. On Fri, Jun 3, 2011 at 11:57 AM, anand karthik anandkarthik@gmail.com wrote: (!printf(Hello)) On Jun 3, 2011 11:52 AM, Arpit Mittal mrmittalro...@gmail.com wrote: Please help me in this question. What's the condition so that the following code prints both HelloWorld ! if condition printf (Hello); else printf(World); -- -Arpit Mittal 6th Semester, Indian Institute of Information Technology,Allahabad Email : arpitmittal.ii...@gmail.com rit2008...@iiita.ac.in Contact : +91-8853049787 Let every man be respected as an individual and no man idolized. -- 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. -- Cheers Naveen Kumar -- 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. -- Cheers Naveen Kumar -- 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. -- Regards, Shachindra A C -- 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 output
1st print : x = x * (3 + 2) - 10 2nd print : x = x * 4 - 40 : while evaluating the expression, the rightmost result will be used 3rd print : x = (4 == 4) - 1 4th print : x == ( y = z ) evaluates to false; prev val of x, 1 is printed On Wed, May 25, 2011 at 3:35 PM, sourabh jakhar sourabhjak...@gmail.comwrote: #includestdio.h #includestdio.h #includeconio.h #define PRINTX printf(%d\n,x) main() { int x=2,y,z; x*=3 + 2; PRINTX; x*= y = z = 4; PRINTX; x = y == z; PRINTX; x == ( y = z ); PRINTX; getch(); } can anyone explain the output -- SOURABH JAKHAR,(CSE)(3 year) The Law of Win says, Let's not do it your way or my way; let's do it the best way. -- 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. -- Regards, Shachindra A C -- 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.