array to linklist

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • jova

    array to linklist

    I'm stuck

    I have to convert an array to a linklist

    the array is initialized as

    public Organization{
    Crew[] members = new Member [10]

    etc....

    }
    I'm trying to get it setup where Crew holds it's members in a linkedlist


    this is what I have so far.
    public Organization{
    private Link beforeAll = new Link(null,null) ;

    etc...
    }

    I just can't figure out how to convert it.


  • Raymond DeCampo

    #2
    Re: array to linklist

    jova wrote:[color=blue]
    > I'm stuck
    >
    > I have to convert an array to a linklist
    >
    > the array is initialized as
    >
    > public Organization{
    > Crew[] members = new Member [10]
    >
    > etc....
    >
    > }
    > I'm trying to get it setup where Crew holds it's members in a linkedlist
    >
    >
    > this is what I have so far.
    > public Organization{
    > private Link beforeAll = new Link(null,null) ;
    >
    > etc...
    > }
    >
    > I just can't figure out how to convert it.
    >
    >[/color]

    This smells like homework. Are you allowed to use the containers
    supplied by the JDK? If so, you should look at the javadoc for
    java.util.Linke dList.

    Ray

    Comment

    • jova

      #3
      Re: array to linklist

      yes it is homework and no I don't think I can use Containers since we never
      cover that in class.
      "Raymond DeCampo" <rdecampo@spa m-I-am-not.twcny.rr.co m> wrote in message
      news:uOAVb.4972 7$n62.44395@twi ster.nyroc.rr.c om...[color=blue]
      > jova wrote:[color=green]
      > > I'm stuck
      > >
      > > I have to convert an array to a linklist
      > >
      > > the array is initialized as
      > >
      > > public Organization{
      > > Crew[] members = new Member [10]
      > >
      > > etc....
      > >
      > > }
      > > I'm trying to get it setup where Crew holds it's members in a[/color][/color]
      linkedlist[color=blue][color=green]
      > >
      > >
      > > this is what I have so far.
      > > public Organization{
      > > private Link beforeAll = new Link(null,null) ;
      > >
      > > etc...
      > > }
      > >
      > > I just can't figure out how to convert it.
      > >
      > >[/color]
      >
      > This smells like homework. Are you allowed to use the containers
      > supplied by the JDK? If so, you should look at the javadoc for
      > java.util.Linke dList.
      >
      > Ray[/color]


      Comment

      Working...