0

I am reading pseudo code for a fundamental linked list and some of the methods have ____.info in them. Here is an example:

Algorithm: ToArray() //Returns an array of items from the list
START
Let Current be a node;
Lat ItemArray be an array of items in the list;
Let X be an integer, initialized to 0; //assume array sub-scripting begins at 0
Current = First;
While(Current <> NULL)
     Increment x by 1;
     ItemArray[x-1] = Current.Info; 
     Current = Current.Next;
End-While;
Return ItemArray;
STOP

What does the .Info do/mean?

4
  • 5
    This doesn't look like Java to me.
    – trooper
    Mar 10, 2015 at 17:07
  • 1
    @trooper He explains it's pseudocode in the first sentence.
    – Kon
    Mar 10, 2015 at 17:08
  • Its pseudo code, so its some member variable or method on the object stored in Current.
    – Noah
    Mar 10, 2015 at 17:10
  • Now don't get excited :P It was mistagged, and has been corrected.
    – trooper
    Mar 10, 2015 at 17:11

1 Answer 1

6

Current in your pseudo code seems to be an element of the list. That basically holds the pointer to the Next element and also the actual data at that position. It seems Info is a bad name for exactly that: the actual data at the position in the list represented by Current.

1
  • Ohhh okay! Thank you! Wasn't sure if .info was specific to java.
    – Oryx
    Mar 10, 2015 at 17:16

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.