Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Node (computer science)
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Nodes and trees == [[File:binary tree.svg|right|192px|thumb|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.<ref>{{cite web|url=http://xlinux.nist.gov/dads//HTML/tree.html|title=tree (data structure)|publisher=[[National Institute of Standards and Technology]]|url-status=live|archive-url=https://web.archive.org/web/20141124223717/http://xlinux.nist.gov/dads/HTML/tree.html|archive-date=2014-11-24}}</ref> 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.<ref>{{cite book | last=Teukolsky | first=Roselyn | title=Barron's AP Computer Science A| url=https://archive.org/details/apcomputerscienc0006teuk | url-access=registration |publisher=[[Barron's Educational Series|Barron's]]|isbn = 978-1-4380-0152-4|year=2013 }}</ref> Data can be discovered along these network paths.<ref>{{cite web|url=http://www.eecs.berkeley.edu/~bh/ssch18/trees.html|title=Simply Scheme: Introducing Computer Science ch 18: Trees|publisher=College Of Engineering, [[University of California, Berkeley]]|url-status=live|archive-url=https://web.archive.org/web/20131222183836/http://www.eecs.berkeley.edu/~bh/ssch18/trees.html|archive-date=2013-12-22}}</ref> 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.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)