Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

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

by Zaxo (Archbishop)
on Sep 03, 2002 at 19:28 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://194876]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (2)
As of 2024-04-19 18:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found