Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
Hmmm... this appears to be a step in the right direction, though I don't need that "sort" in there. You see, numerical order is of no importance... only the order in which it appears in the array. It's like this:

my @array1 = (1, 3, 4, 6); my @array2 = (1, 2, 4, 6); my @array3 = (1, 2, 3, 5);
So, the program looks as the first array, and notes its order. Then, it looks at the second array, and notices that "2" hasn't been seen before. It notes that it goes after "1" and before "4". At this point, the logical order could be either

(1, 2, 3, 4, 6) or
(1, 3, 2, 4, 6)

It doesn't matter which it chooses. Then, it examines the third array and realizes that "2" comes before "3". Plus, the "5" is new, and comes after "3". So, now the order could be:

(1, 2, 3, 4, 5, 6) or
(1, 2, 3, 4, 6, 5)

Does that make sense?

In reply to Re: Re: "Intelligent" array joining by ngomong
in thread "Intelligent" array joining by ngomong

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (2)
As of 2024-03-19 04:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found