CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner: Re: [zing] Problem printing return value from a subroutine: Edit Log



zing
Novice

Oct 5, 2012, 5:26 AM


Views: 3500
Re: [zing] Problem printing return value from a subroutine

The code fails on this data

Code
---------DATA-------------- 
b c a
a c d
d e b
e f g
g d f
h i g


And the output is

Code
component 2 = e d g f 
component 1 = c a b
b c a

Which is wrong, because it should have been this

Code
component 2 = e d g f 
e f g
g d f
component 1 = c a b
b c a

Because with the vertices in component 2, we can have 4th & 5th row of DATA.
Please help on this


(This post was edited by zing on Oct 5, 2012, 5:28 AM)


Edit Log:
Post edited by zing (Novice) on Oct 5, 2012, 5:28 AM


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives