Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我是数据结构的新手。当我尝试使用 C++ 使用链表编写代码时,我提出了一个问题。
在链表中,指针是由编译器定义的吗next?previous或者我们必须为自己命名,而我们如何称呼它并不重要?
next
previous
next并且previous不是预定义的。我们必须自己定义它。通常对于单个链表,我们会提出一个节点结构,该结构由一个数据字段和一个next指针组成,该指针是指向同一类型节点的指针。一个简单的例子如下:
struct node{ int data; //data part struct node *next; // next pointer - points to a node of the same type }