Re: Help !!!!!!!
- To: mathgroup at smc.vnet.net
- Subject: [mg12911] Re: [mg12778] Help !!!!!!!
- From: "Jrgen Tischer" <jtischer at col2.telecom.com.co>
- Date: Wed, 24 Jun 1998 03:44:33 -0400
- Sender: owner-wri-mathgroup at wolfram.com
Hi, Henrique Gloria etc, In[1]:= ru[{a_,b_}]:={{{x_,a}}->{{x,a},{{a,b}}},{{x_,a},l__}->{{x,a},l,{{a,b}}} } In[2]:= fu[li_List,{a_,b_}]:=If[FreeQ[li,{_,a}],{li,{{a,b}}},li/.ru[{a,b}]] In[3]:= Fold[fu,{First[A]},Rest[A]] Jrgen -----Original Message----- From: Gloria <terravella at redestb.es> To: mathgroup at smc.vnet.net Subject: [mg12911] [mg12778] Help !!!!!!! > > Hi: > > How Can I convert the list A to list B ?? > > > A= >{{1,2},{1,3},{2,4},{2,5},{4,6},{4,7},{5,8},{5,9},{6,10},{6,11},{7,12},{7 ,13 } >,{10,14},{10,15},{10,16},{11,17},{11,18},{11,19},{12,20},{12,21}} > > > B= >{{{1,2},{{2,4},{{4,6},{{6,10},{{10,14}},{{10,15}},{{10,16}}},{{6,11},{{1 1,1 7 >}},{{11,18}},{{11,19}}}},{{4,7},{{7,12},{{12,20}},{{12,21}}},{{7,13}}}}, {{2 , >5},{{5,8}},{{5,9}}}},{{1,3}}} > > > Thank you for your help. > > Henrique cao > > carraldeprada at redestb.es > > >