Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Finding Eulerian Path

by youlose (Scribe)
on Oct 27, 2010 at 09:42 UTC ( [id://867669]=note: print w/replies, xml ) Need Help??


in reply to Finding Eulerian Path

Hi,

you are deleting elements from arrays with delete

but perldoc tells us:
delete() may also be used on arrays and array slices, but its behavior is less straightforward. Although exists() will return false for deleted entries, deleting array elements never changes indices of existing values; use shift() or splice() for that. However, if all deleted elements fall at the end of an array, the array's size shrinks to the position of the highest element that still tests true for exists(), or to 0 if none do. Be aware that calling delete on array values is deprecated and likely to be removed in a future version of Perl.

So, refactor your code and replace delete with proper code with splice

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (3)
As of 2024-04-20 14:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found