Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Re: •SPOILERS Re: (OT) Interview questions -- your response?

by Zaxo (Archbishop)
on Sep 03, 2002 at 19:28 UTC ( #194876=note: print w/replies, xml ) Need Help??


in reply to Re: •SPOILERS Re: (OT) Interview questions -- your response?
in thread (OT) Interview questions -- your response?

Fencepost error. I think you mean:

@array[$_,-$_-1]=@array[-$_-1,$_] for 0..$#array/2;

The middle pair was swapped twice to no effect for even sized arrays, the middle element swapped with itself for odd.

After Compline,
Zaxo

  • Comment on Re: Re: •SPOILERS Re: (OT) Interview questions -- your response?
  • Download Code

Replies are listed 'Best First'.
•Re: Re: Re: •SPOILERS Re: (OT) Interview questions -- your response?
by merlyn (Sage) on Sep 03, 2002 at 19:39 UTC
    I actually did #2 the way I did to avoid a fencepost error. And it's proveably correct.

    And think of the maintenance programmer. I'd not want to maintain your code.

    -- Randal L. Schwartz, Perl hacker

Re: Re: Re: •SPOILERS Re: (OT) Interview questions -- your response?
by demerphq (Chancellor) on Sep 04, 2002 at 08:44 UTC
    Busted.

    Oh well.

    I guess I didn't get the job.

    Yves / DeMerphq
    ---
    Software Engineering is Programming when you can't. -- E. W. Dijkstra (RIP)

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://194876]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (9)
As of 2019-05-27 13:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you enjoy 3D movies?



    Results (156 votes). Check out past polls.

    Notices?