World Library  
Flag as Inappropriate
Email this Article

Node (computer science)

Article Id: WHEBN0000998074
Reproduction Date:

Title: Node (computer science)  
Author: World Heritage Encyclopedia
Language: English
Subject: Grid computing, Linked list, Tree (data structure), Fold (higher-order function), Sentinel node
Collection: Data Structures
Publisher: World Heritage Encyclopedia

Node (computer science)

A node is a basic unit used in computer science. Nodes are devices or data points on a larger network. Devices such as a personal computer, cell phone, or printer are nodes. When defining nodes on the internet, a node is anything that has an IP address. Nodes are individual parts of a larger data structure, such as linked lists and tree data structures. Nodes contain data and also may link to other nodes. Links between nodes are often implemented by pointers.

In graph theory, the image provides a simplified view of a network, where each of the numbers represents a different node.


  • Nodes and trees 1
    • Definitions 1.1
    • Markup languages 1.2
      • Node type 1.2.1
      • Node object 1.2.2
  • References 2
  • External links 3

Nodes and trees

A simple binary tree of size 9 and height 3, with a root node whose value is 2. The above tree is unbalanced and not sorted.

Nodes are often arranged into tree structures. These structures are binary trees.[1]

A node represents the information contained in a single structure. These nodes may contain a value or condition, or possibly serve as another independent data structure. Nodes are represented by a single parent node. The highest point on a tree structure is called a root node, which does not have a parent node, but serves as the parent or 'grandparent' of all of the nodes below it in the tree. The height of a node is determined by the longest path from root node to the furthest leaf node, and the height of the tree is equal to the height of the root node.[2] Node depth is determined by the distance between that particular node and the root node. The root node is said to have a depth of zero.[3] Data can be discovered along these network paths. An IP address uses this kind of system of nodes to define its location in a network. [4]


  • Child: A child node is a node extending from another node. For example, a computer with internet access could be considered a child node of a node representing the internet. The inverse relationship is that of a parent node. If node C is a child of node A, then A is the parent node of C.
  • Degree: the degree of a node is the number of children of the node.
  • Depth: the depth of node A is the length of the path from A to the root node. The root node is said to have depth 0.
  • Edge: the connection between nodes.
  • Forest: a set of trees.
  • Height: the height of node A is the length of the longest path through children to a leaf node.
  • Internal node: a node with at least one child.
  • Leaf node: a node with no children.
  • Root node: a node distinguished from the rest of the tree nodes. Usually, it is depicted as the highest node of the tree.
  • Sibling nodes: these are nodes connected to the same parent node.

Markup languages

Another common use of node trees is in web development. In programming, XML is used to communicate information between computer programmers and computers alike. For this reason XML is used to create common communication protocols used in office productivity software, and serves as the base for the development of modern web markup languages like XHTML. Though similar in how it is approached by a programer, HTML and CSS is typically the language used to develop website text and design. While XML, HTML and XHTML provide the language and expression, DOM serves as a translator.[5]

Node type

Different types of nodes in a tree are represented by a specific interfaces. In other words, the node type is defined by how it communicates with other nodes. Each node has a node type property, which specifies the type of node, such as sibling or leaf. For example, if the node type property is the constant properties for a node, this property specifies the type of the node. So if a node type property is the constant node ELEMENT_NODE, one can know that this node object is an object Element. This object uses Element interface to define all the methods and properties of that particular node. Node Types

Different W3C World Wide Web Consortium node types and descriptions:

  • Document represents the entire document (the root-node of the DOM tree)
  • DocumentFragment represents a "lightweight" Document object, which can hold a portion of a document
  • DocumentType provides an interface to the entities defined for the document
  • ProcessingInstruction represents a processing instruction
  • EntityReference represents an entity reference
  • Element represents an element
  • Attr represents an attribute
  • Text represents textual content in an element or attribute
  • CDATASection represents a CDATA section in a document (text that will NOT be parsed by a parser)
  • Comment represents a comment
  • Entity represents an entity
  • Notation represents a notation declared in the DTD
NodeType Named constant

Node object

A node object is represented by a single node in a tree. It can be an element node, attribute node, text node, or any type that is described in section "node type". All objects can inherit properties and methods for dealing with parent and child nodes, but not all of the objects have parent or child nodes. For example, text nodes that cannot have child nodes, similar nodes to add child nodes results in a DOM error.

Objects in the DOM tree may be addressed and manipulated by using methods on the objects. The public interface of a DOM is specified in its application programming interface (API). The history of the Document Object Model is intertwined with the history of the "browser wars" of the late 1990s between Netscape Navigator and Microsoft Internet Explorer, as well as with that of JavaScript and JScript, the first scripting languages to be widely implemented in the layout engines of web browsers.


  1. ^ "Binary Trees, Data Structures and Algorithms". 
  2. ^ "tree (data structure)".  
  3. ^ Teukolsky, Roselyn (2013). Barron's AP Computer Science A.  
  4. ^ "Simply Scheme: Introducing Computer Science ch 18: Trees". College Of Engineering,  
  5. ^ "XML DOM Introduction".  

External links

  • Data Trees as a Means of Presenting Complex Data Analysis by Sally Knipe
  • STL-like C++ tree class
  • Description of tree data structures from
  • Cell TreeC. Interactive Visualization of the - Visualize the entire cell lineage tree of the nematode C. elegans (javascript)
This article was sourced from Creative Commons Attribution-ShareAlike License; additional terms may apply. World Heritage Encyclopedia content is assembled from numerous content providers, Open Access Publishing, and in compliance with The Fair Access to Science and Technology Research Act (FASTR), Wikimedia Foundation, Inc., Public Library of Science, The Encyclopedia of Life, Open Book Publishers (OBP), PubMed, U.S. National Library of Medicine, National Center for Biotechnology Information, U.S. National Library of Medicine, National Institutes of Health (NIH), U.S. Department of Health & Human Services, and, which sources content from all federal, state, local, tribal, and territorial government publication portals (.gov, .mil, .edu). Funding for and content contributors is made possible from the U.S. Congress, E-Government Act of 2002.
Crowd sourced content that is contributed to World Heritage Encyclopedia is peer reviewed and edited by our editorial staff to ensure quality scholarly research articles.
By using this site, you agree to the Terms of Use and Privacy Policy. World Heritage Encyclopedia™ is a registered trademark of the World Public Library Association, a non-profit organization.

Copyright © World Library Foundation. All rights reserved. eBooks from Project Gutenberg are sponsored by the World Library Foundation,
a 501c(4) Member's Support Non-Profit Organization, and is NOT affiliated with any governmental agency or department.