Nodes

I was reading through other threads and seen the term nodes. I tried to find it very quickly but to no avail. If someone could give me a simplistic explanation that would be great and maybe even a slice of code so I could see an example. Cheers :)
"each node is composed of data and a reference (in other words, a link) to the next node in the sequence; more complex variants add additional links."

"Singly linked lists contain nodes which have a data field as well as a 'next' field, which points to the next node in line of nodes."

"In a 'doubly linked list', each node contains, besides the next-node link, a second link field pointing to the 'previous' node in the sequence."
https://en.wikipedia.org/wiki/Linked_list#Singly_linked_list

There are diagrams (and code snippets) on the wiki page.

Also see:
"a tree is a widely used abstract data type (ADT)--or data structure implementing this ADT--that simulates a hierarchical tree structure, with a root value and subtrees of children with a parent node, represented as a set of linked nodes.

A tree data structure can be defined recursively (locally) as a collection of nodes (starting at a root node), where each node is a data structure consisting of a value, together with a list of references to nodes (the "children")"
https://en.wikipedia.org/wiki/Tree_(data_structure)
Wow, okay that was very helpful thanks for the information!
Topic archived. No new replies allowed.