Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

access array

 
Castulo Ruiz
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not sure how to access an array of linked list.

I have an ADT of linked list and I have created an array of linked list.
The problem I have is that when i call a funtion getLength

well this is how I access it.

 
Campbell Ritchie
Sheriff
Posts: 48646
56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You would have to provide more details of where the array is.
 
Thakur Sachin Singh
Ranch Hand
Posts: 248
Hibernate Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
give some more details...your requirement is not clear.
 
Castulo Ruiz
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the array is an Object array that holds a linked list.
The linked list holds objects as well.

an ADT of a linked list has been created for this project.

In the end the array is nothing more than an array of List.

the list will represent a matrix.

to create a matrix:
// this will create a nxn matrix.
Matrix A = new Matrix(2);

now I have to to able to change the contents of the list.
In order to able to to this I must first access the matrix then the array and finally the linked list.

inside Matrix() the following is being done:
// an array of list.
List row[]= new List[n];
then just code on creating the matrix

so the main problem is when i create a new matrix 'A' I am not sure how to access what is inside.
can it be like something like this?
// diplayForward prints out the linkedlist.
A.row[0].displayForward();
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic