Share to: share facebook share twitter share wa share telegram print page

Node (computer science)

A node is a basic unit of a data structure, such as a linked list or tree data structure. 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

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. A node represents the information contained in a single data 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 total number of edges on the path from that node to the furthest leaf node, and the height of the tree is equal to the height of the root node.[1] 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.[2] Data can be discovered along these network paths.[3] An IP address uses this kind of system of nodes to define its location in a network.

Definitions

  • 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 programmer, HTML and CSS is typically the language used to develop website text and design. While XML, HTML and XHTML provide the language and expression, the DOM serves as a translator.[4]

Node type

Different types of nodes in a tree are represented by 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 the Element interface to define all the methods and properties of that particular node.

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
1 ELEMENT_NODE
2 ATTRIBUTE_NODE
3 TEXT_NODE
4 CDATA_SECTION_NODE
5 ENTITY_REFERENCE_NODE
6 ENTITY_NODE
7 PROCESSING_INSTRUCTION_NODE
8 COMMENT_NODE
9 DOCUMENT_NODE
10 DOCUMENT_TYPE_NODE
11 DOCUMENT_FRAGMENT_NODE
12 NOTATION_NODE

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, with text nodes that cannot have child nodes, trying 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.

See also

References

  1. ^ "tree (data structure)". National Institute of Standards and Technology. Archived from the original on 2014-11-24.
  2. ^ Teukolsky, Roselyn (2013). Barron's AP Computer Science A. Barron's. ISBN 978-1-4380-0152-4.
  3. ^ "Simply Scheme: Introducing Computer Science ch 18: Trees". College Of Engineering, University of California, Berkeley. Archived from the original on 2013-12-22.
  4. ^ "XML DOM Introduction". W3Schools. Archived from the original on 2014-06-11. Retrieved 2018-04-07.

External links

Read other articles:

City in TexasSullivan City, TexasCityCity of Sullivan CityLocation of Sullivan City, TexasCoordinates: 26°16′30″N 98°34′6″W / 26.27500°N 98.56833°W / 26.27500; -98.56833Country United States of AmericaState TexasCounty HidalgoArea[1] • Total3.59 sq mi (9.30 km2) • Land3.59 sq mi (9.30 km2) • Water0.00 sq mi (0.00 km2)Elevation200 ft (61 m)Population…

كأس اليونان 1979–80 تفاصيل الموسم كأس اليونان  النسخة 38  البلد اليونان  المنظم الاتحاد الإغريقي لكرة القدم  عدد المشاركين 58   كأس اليونان 1978–79  كأس اليونان 1980–81  تعديل مصدري - تعديل   كأس اليونان 1979–80 (باليونانية: Κύπελλο Ελλάδος ποδοσφαίρου ανδρών 1979-80)‏ ه…

Державний історико-культурний заповідник «Трипільська культура» 48°47′33″ пн. ш. 30°30′47″ сх. д. / 48.792667° пн. ш. 30.513056° сх. д. / 48.792667; 30.513056Координати: 48°47′33″ пн. ш. 30°30′47″ сх. д. / 48.792667° пн. ш. 30.513056° сх. д. / 48.792667; 3…

Por un Mundo Más Justo Presidente Antonio Sieira MucientesLíder Jorge Serrano ParadinasFundación 8 de enero de 2004Eslogan El fin de la pobreza en el mundo es una decisión política.Ideología Europeísmo Ecologismo InternacionalismoPosición TransversalismoSede C/ Romero Leal, 3, MéridaPaís España EspañaConcejales 0/67 515Sitio web www.porunmundomasjusto.esFacebook https://www.facebook.com/partidoporunmundomasjusto[editar datos en Wikidata] Por un Mundo Más Justo (M…

Les monastères d'Ukraine dépendent principalement des cinq églises qui coexistent en Ukraine : Église catholique Église grecque-catholique ukrainienne, abréviée ici en EGC Église orthodoxe d'Ukraine (Patriarcat de Kiev), abréviée ici en PK Église orthodoxe d'Ukraine (Patriarcat de Moscou), abréviée ici en PM Église orthodoxe autocéphale ukrainienne, abréviée ici en EAU L'histoire mouvementée de l'Ukraine, notamment religieuse, avec la lutte entre l'influence catholique et …

فرتون غارسيز ملك نافارا (بالبشكنشية: Orti Gartzez)‏    معلومات شخصية تاريخ الميلاد 830 الوفاة 906 مواطنة مملكة نبرة  [لغات أخرى]‏  الأب غارسيا إنيغيز ملك نافارا  مناصب الحياة العملية المهنة حاكم  [لغات أخرى]‏،  وراهب  اللغات البشكنشية  تعديل مصدري - تعد…

Este artículo o sección necesita referencias que aparezcan en una publicación acreditada.Este aviso fue puesto el 31 de diciembre de 2017. Representación tridimensional de vóxeles. El vóxel (del inglés volumetric pixel)[1]​ es la unidad cúbica que compone un objeto tridimensional. Constituye la unidad mínima procesable de una matriz tridimensional y es, por tanto, el equivalente del píxel en un objeto 2D. Características Para crear una imagen en tres dimensiones, los vóxeles ti…

1994 soundtrack album by Elton John and Hans Zimmer The Lion King: Original Motion Picture SoundtrackArtwork for original releaseSoundtrack album by Elton John, Hans Zimmer and various artistsReleased May 31, 1994 (original release) September 30, 2003 (Special Edition) Recorded1993–94Studio Media Ventures, Los Angeles Ocean Way Studios, Los Angeles Snake Ranch, London Angel Recording Studios, London BOP Studios, Mmabatho GenreWorldfilm scorepopLength 46:40 (1994 original release) 52:08 (20…

Listing of rating of Australian wine Langton's logo. Langton's Classification of Australian Wine is a listing of fine Australian wines compiled by wine-specialist auction house and online merchant Langton's. The Classification is a ranking of the best-performing Australian wines based on secondary market support over a minimum of 10 vintages. It was first published in 1991.[1][2][3][4] The Classification is divided into three categories - Exceptional, Outstanding …

هذه المقالة يتيمة إذ تصل إليها مقالات أخرى قليلة جدًا. فضلًا، ساعد بإضافة وصلة إليها في مقالات متعلقة بها. (يونيو 2019) ستيفاني باتون   معلومات شخصية الميلاد سنة 1969 (العمر 53–54 سنة)  نيو أورلينز  مواطنة الولايات المتحدة[1]  الحياة العملية المهنة رسامة،  وفنانة ف…

Serbian singer-songwriter (born 1992) Luke BlackBlack at Pesma za Evroviziju '23, 2023Background informationBirth nameLuka IvanovićBorn (1992-05-18) 18 May 1992 (age 31)Čačak, FR Yugoslavia (present-day Serbia)Genres Electropop dream pop synth-pop Occupation(s) Singer songwriter Instrument(s) Vocals piano Years active2014–presentLabelsGruvlendUniversal (former)Websitelukeblackmusic.comMusical artist Luka Ivanović (Serbian: Лука Ивановић; born 18 May 1992), known profession…

KritaPengembangKrita Foundation, KDERilis perdana21 Juni 2005; 18 tahun lalu (2005-06-21)Repositorigit repo on KDESistem operasiLinux, Windows,[1] macOS[1]Ukuran111–201 MiB (bervariasi sesuai sistem operasi)Tersedia dalamC++, QtJenisRaster graphics editorLisensiGPLv2 +Situs webkrita.orgKrita adalah perangkat lunak bebas dan sumber terbuka untuk editor grafis raster, yang dirancang terutama untuk menggambar, melukis, dan animasi. Krita memiliki antar muka yang sederhana, ak…

Xbox > Xbox One > Xbox Oneのゲームタイトル一覧 この項目は、発売前あるいは配信・稼働開始前のコンピュータゲームを扱っています。情報が解禁されていくに従い、この項目の内容も大きく変化することがありますのでご注意ください。投稿者は推測や予想を加えないようにしてください。投稿の際は脚注などを用いて随時その記述の根拠となる情報源を明記する…

Гвен Стефани возглавляла чарт в течение 9 недель Канье Уэст вместе с Джейми Фоксом также лидировал в хит-параде 9 недель 50 Cent находился на 1 месте 8 недель подряд Рианна находилась на вершине 5 недель Список цифровых синглов № 1 США 2005 года представляет собой список сингло…

Women's K-1 500 metres at the 2023 ICF Canoe SprintWorld ChampionshipsVenueSportpark DuisburgLocationDuisburg, GermanyDates23-26 AugustCompetitors47 from 47 nationsWinning time1:47.769Medalists  Lisa Carrington   New Zealand Emma Jørgensen   Denmark Tamara Csipes   Hungary← 20222025 → 2023 ICF Canoe SprintWorld ChampionshipsCanoe eventsC-1 200mmenwomenC-1 500mmenwomenC-1 1000mmenwomenC-1 5000mmenwomenC-2…

1923 film Fräulein RaffkeRussian posterDirected byRichard EichbergWritten byHans BehrendtHelmuth OrthmannProduced byRichard EichbergStarringWerner KraussLydia PotechinaLee ParryCinematographyErich GrimmlerHeinrich GärtnerProductioncompanyRichard Eichberg-FilmDistributed bySüd-FilmRelease date18 September 1923Running time60 minutesCountryGermanyLanguagesSilent German intertitles Fräulein Raffke is a 1923 German silent film directed by Richard Eichberg and starring Werner Krauss, Lydia Potechi…

Polish media company This article's factual accuracy may be compromised due to out-of-date information. Please help update this article to reflect recent events or newly available information. (February 2020) AgoraAgora's headquarters in Warsaw.TypePublicTraded asWSE: AGOLSE: 0MNMIndustryMass mediaFoundedWarsaw, Poland (1989)HeadquartersWarsaw, PolandKey peopleBartosz Hojka (Executive Chairman)Adam Michnik (Co-founder)ProductsGazeta WyborczaRevenue PLN 836.5 million (2020)[1]Nu…

Local tales and legends from Romania This article has multiple issues. Please help improve it or discuss these issues on the talk page. (Learn how and when to remove these template messages) This article needs additional citations for verification. Please help improve this article by adding citations to reliable sources. Unsourced material may be challenged and removed.Find sources: Folklore of Romania – news · newspapers · books · scholar · JSTOR (June 2…

Medieval tower house, County Clare, Ireland Knappogue CastleCaisleán na CnapóigeCounty Clare, Ireland Knappogue CastleKnappogue CastleCoordinates52°47′38″N 8°49′54″W / 52.793919°N 8.831597°W / 52.793919; -8.831597Site informationOwnerShannon HeritageOpen tothe publicyesSite historyBuilt1467 (1467)Built bySeán Mac Conmara (MacNamara) Knappogue Castle (Irish: Caisleán na Cnapóige[1]) is a tower house, built in 1467 and expanded i…

London Underground & National Rail station Greenford GWR Class 165 in the bay platform at GreenfordGreenfordLocation of Greenford in Greater LondonLocationGreenfordLocal authorityLondon Borough of EalingManaged byLondon UndergroundOwnerTransport for LondonStation codeGFDNumber of platforms3 (2 LU, 1 bay); 1 bay platform face disusedFare zone4London Underground annual entry and exit2018 4.25 million[1]2019 4.17 million[2]2020 2.96 million[3]2021 2.05 million[4]…

Kembali kehalaman sebelumnya

Lokasi Pengunjung: 3.135.203.206