Home > Common Problem > body text

What is the difference between node and node

清浅
Release: 2020-10-13 13:35:11
Original
61479 people have browsed it

The difference between a node and a node is: 1. A node is an entity, which has the ability to process; 2. A node is an intersection or a mark. The points in the algorithm are generally called nodes. Each data element in the data set is represented by a box with the element value in the middle, which we call a node.

What is the difference between node and node

The difference between a node and a node is: a node is an entity with the ability to process; while a node is an intersection, a mark, in general algorithms The points are called nodes.

The pronunciation of the two words node and node is the same, but the meanings they express are completely different like their words. Next, I will introduce the difference between the two in detail in the article. The difference, I hope it will be helpful to everyone.

What is the difference between node and node

【Recommended tutorial: C language tutorial

A node is considered an entity with processing capabilities, such as a computer on the network; while a node is just an intersection, like "knotting notes", tie a knot, make a mark, that's it. Also, remember: in general algorithms, all points are nodes.

In the graphical representation of the data structure, each data element in the data set is represented by a box with the element value in the middle. It is generally called a data node, or a node for short. In the linked list data structure, each element in the linked list is called a "node", and each node should include two parts: one is the actual data data that needs to be used; the other is the pointer that stores the address of the next node. That is, data domain and pointer domain. Each data node in the data structure corresponds to a storage unit. This storage unit is called a storage node, or simply a node.

Speaking of which, let me add another piece of knowledge about linked lists. What are the predecessors and successors in the linked list?

(1) For linear storage structure:

1, 2, 3, ......, n, n+1, .......
Copy after login

The direct predecessor node of node n 1 is n node

( 2) For the linked list storage structure

// 结点的定义
struct node
{
int data; // 数据域
struct node* next; // 指针域 
};
Copy after login

in the above data structure, struct node* head represents the head node of the linked list, head->next represents the successor node of the head node head; and head is the predecessor node of head->next.

The above is the detailed content of What is the difference between node and node. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template