go ahead... be a heretic PerlMonks

### Re^3: splicing two arrays together

by TJPride (Pilgrim)
 on Jan 06, 2012 at 20:58 UTC ( #946665=note: print w/replies, xml ) Need Help??

in reply to Re^2: splicing two arrays together
in thread splicing two arrays together

Actually, it's an independent solution that just happens to be mostly identical to yours. My determination of "best" is that the OP asked for a solution with splice, and this was the best solution possible with splice. Obviously, splice is not the most efficient way to do this overall, but that's the OP's problem, since he framed the question in the context of splice rather than the context of finding the most efficient way to do merge two arrays. I'm guessing it's a homework problem and they said he had to use splice.

Create A New User
Node Status?
node history
Node Type: note [id://946665]
help
Chatterbox?
 [Eily]: Discipulus by demonstrate I suppose you mean simulate with perl? [Eily]: the demonstration itself is fairly easy. The number of paths on a node is the sum of the numbers of paths to the two nodes above (or one node above on the edges of the triangle) [Eily]: since the value of a node is also the sum from the two nodes above, you just have to demonstrate that the equality is true at the top of the triangle [Discipulus]: yes Eily, thanks oiskuu but i dont get it.. ;=( maybe I'll ask a SOPW [LanX]: all combinations with same amount of left and right? [Eily]: if you want to store in a structure with the coordinates as key, arrays might do, since the keys are going to be 0..n [LanX]: (Pascale path) [Discipulus]: yes Eily++ (very keen) I want to integrate my project with a 17th experiments. I want to colorize in sequence all paths [oiskuu]: Yeah, modifry the recursive func combinations() to return not the number, but the paths themselves.

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (9)
As of 2018-03-19 11:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
Voting Booth?
When I think of a mole I think of:

Results (239 votes). Check out past polls.

Notices?