Can a Node contain more than one piece of data?


#1

Question

In this exercise, the Node structure is shown to contain only a single number. Can a Node contain more than one piece of data?

Answer

Yes, a Node can contain whatever data items are needed by the program. For example, a linked list of employees may require Node elements which contain the employee name and employee identifier. Regardless of what data is kept in the Node, all must contain at least a link to the next Node.