Node (computer science)

Node (computer science)

A node is a record consisting of one or more fields that are links to other nodes, and a data field. The link and data fields are often implemented by pointers or references although it is also quite common for the data to be embedded directly in the node. Nodes are used to build linked, often hierarchical, data structures such as linked lists, trees, and graphs. Large and complex data structures can be formed from groups of interlinked nodes. Nodes are conceptually similar to vertices, which are elements of a graph. Software is said to have a node graph architecture when its organization consists of interlinked nodes.

Pseudocode implementation examples

A node containing a single node reference field.

 record SinglyLinkedNode {
    next, // A reference to the next node
    data // Data or reference to data
 }

Here, three such nodes form a singly linked list of length 3: Node chain.svg


A node containing two node reference fields.

 record DoublyLinkedNode {
    previous, // A reference to the previous node
    next, // A reference to the next node
    data // Data or reference to data
 }

Here three such nodes form a doubly linked list of length 3: Doubly-linked-list.svg


Also common is a binary tree node containing references to left and right child nodes, and a reference to a parent node.

 record BinaryNode {
    parent, // A reference to the parent node                                
    left_child, // A reference to the left child node
    right_child, // A reference to the right child node
    data // Data or reference to data
 }

See also

  • Recursive data type

Wikimedia Foundation. 2010.

Игры ⚽ Поможем решить контрольную работу

Look at other dictionaries:

  • Goal node (computer science) — In computer science, a goal node is a node in a graph that meets defined criteria for success or termination.Heuristical artificial intelligence algorithms, like A*, attempt to reach such nodes in optimal time by defining the distance to the goal …   Wikipedia

  • computer science — computer scientist. the science that deals with the theory and methods of processing information in digital computers, the design of computer hardware and software, and the applications of computers. [1970 75] * * * Study of computers, their… …   Universalium

  • computer science — noun the branch of engineering science that studies (with the aid of computers) computable processes and structures • Syn: ↑computing • Topics: ↑computer, ↑computing machine, ↑computing device, ↑data processor, ↑electronic computer, ↑ …   Useful english dictionary

  • Portal:Computer science — Wikipedia portals: Culture Geography Health History Mathematics Natural sciences People Philosophy Religion Society Technology …   Wikipedia

  • Recursion (computer science) — Recursion in computer science is a way of thinking about and solving problems. It is, in fact, one of the central ideas of computer science. [cite book last = Epp first = Susanna title = Discrete Mathematics with Applications year=1995… …   Wikipedia

  • Polymorphism (computer science) — This article is about the programming language theory concepts with direct application to functional programming languages. For a gentler introduction of these notions as commonly implemented in object oriented programming, see Polymorphism in… …   Wikipedia

  • Decomposition (computer science) — Decomposition in computer science, also known as factoring, refers to the process by which a complex problem or system is broken down into parts that are easier to conceive, understand, program, and maintain. Contents 1 Overview 2 Decomposition… …   Wikipedia

  • Upstream (computer science) — The word upstream has several meanings in the field of computer science. Software Development Upstream in software development refers to a direction toward the original authors or maintainers of software that is distributed as source code, and is …   Wikipedia

  • List of important publications in computer science — This is a list of important publications in computer science, organized by field. Some reasons why a particular publication might be regarded as important: Topic creator – A publication that created a new topic Breakthrough – A publication that… …   Wikipedia

  • Replication (computer science) — Replication is the process of sharing information so as to ensure consistency between redundant resources, such as software or hardware components, to improve reliability, fault tolerance, or accessibility. It could be data replication if the… …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”