I am starting data structures in C++ and while reading, I came up to the following snippet,
template <class Node_entry>
struct Node {
// data members
Node_entry entry;
Node<Node_entry> *next;
// constructors
Node( );
Node(Node_entry, Node<Node_entry> *link = NULL);
};
Can anyone please elaborate why the author choose a structure and not a class for the implementation of the singly linked list
? Thanks.