• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

reference to array element

 
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi everyone,
iv currently got a minimal spanning tree style piece of code. I currently have a start vertex and an edge away. Next i want to retrieve the name of the next vertex that this edge leads to.

Currently i have the following code:

where:
n is an array of vertice names
ce[i] is the chosen edge

i want the value for i, say that it represents element 3 in the array, i want this to then choose element 3 in the array of vertice names as this is the next vertice that it leads to.
im sorry if the question seems a little unclear, this is the best way i could think to propose it.
Thanks in advance
 
ernest mcdermott
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi all, ok iv now got it going the right direction, but the problem is that it outputs the word null as oposed to the vertex name. Can any1 suggest what might be wrong.
Thanks in advance.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic