Win a copy of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

access array  RSS feed

 
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.

 
Marshal
Posts: 60127
188
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You would have to provide more details of where the array is.
 
Ranch Hand
Posts: 251
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();
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!