Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.programming > #2017

Re: problem 2.1.2 from "how to solve it by computer, Dromey"

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!border3.nntp.dca.giganews.com!Xl.tags.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local2.nntp.dca.giganews.com!nntp.earthlink.com!news.earthlink.com.POSTED!not-for-mail
NNTP-Posting-Date Sat, 28 Jul 2012 23:03:10 -0500
Message-ID <5014B5FE.2FC3@mindspring.com> (permalink)
Date Sun, 29 Jul 2012 00:03:10 -0400
From pete <pfiland@mindspring.com>
Reply-To pfiland@mindspring.com
Organization PF
X-Mailer Mozilla 3.04Gold (WinNT; I)
MIME-Version 1.0
Newsgroups comp.programming
Subject Re: problem 2.1.2 from "how to solve it by computer, Dromey"
References <e531d211-e0ad-47d5-8b68-542b3fef915f@googlegroups.com>
Content-Type text/plain; charset=us-ascii
Content-Transfer-Encoding 7bit
Lines 28
X-Usenet-Provider http://www.giganews.com
NNTP-Posting-Host 4.154.220.167
X-Trace sv3-6bgtBCGypN+k0G7e+x2ilHP4wnCU4kT4Tr5oOHFRyq0O+Tw3lQ3ERVu8zG6Y2wwbLmHqOvOXNzix3sj!odkdSqyG/JxV2po6TCnqtu75BaBP/Q3lQltjdG1bh7ksJaKz2/f7mgcMF9FbPDspaAXDXZYmibIg!8KFZer78QZk=
X-Abuse-and-DMCA-Info Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info Otherwise we will be unable to process your complaint properly
X-Postfilter 1.3.40
X-Original-Bytes 1547
Xref csiph.com comp.programming:2017

Show key headers only | View raw


sathyashrayan wrote:
> 
> I am a beginner in learning algo..So please bear with me..
> 
> 2.1.2 Design an algorithm that makes following exchanges of 3 varioubles..
> 
> a-->b-->c--|
> ^          |
> ^----------|
> 
> So
> a_temp = a;
> b_temp = b;
> c_temp = c;
> 
> a=c_temp;
> c=b_temp;
> b=a_temp;
> 
> I know this process looks ugly. Can anyone suggest a good one so that I could learn.

temp = c
   c = b
   b = a
   a = temp

-- 
pete

Back to comp.programming | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

problem 2.1.2 from "how to solve it by computer, Dromey" sathyashrayan <sathyashrayan@gmail.com> - 2012-07-28 19:24 -0700
  Re: problem 2.1.2 from "how to solve it by computer, Dromey" pete <pfiland@mindspring.com> - 2012-07-29 00:03 -0400
    Re: problem 2.1.2 from "how to solve it by computer, Dromey" pete <pfiland@mindspring.com> - 2012-08-01 12:26 -0400

csiph-web