Index
Basics
Concepts (and Structure)
Examples - With Data
Nulls
What are these nodes we see in the tree? E.g., displayed as 10,20, 30, and 40 here.
Let's drill into them now.
20
| --------------+-------------- | |
10
40
-----+ |
30
Basics
The binary search tree node (BSTNode) is the fundamental
building block
of a BST tree.
All of the node junctions in the BST -- these are all BSTNode instances.
About me:
My name means
"binary search tree node"
Please note that I tend to use "data" and "element" interchangeably
I hold data (like other data structure nodes)
I point (reference) two sub-nodes (a "leftNode" and a "rightNode")
Either or both of my sub-nodes may be null
In this chapter, the term "Node" or "node" may be used as an abbreviation for a BSTNode
Associated video...
Concepts (and Structure)
Node Has Data
My primary job is to hold data (an element). My data may be any type -- City, Person, etc.
Node Has Sub-Nodes
I have two links to sub-nodes, one to the left and one to the right.
These links allow navigation through a tree.
Complete Node
Here is a complete sketch of me -- I have data and sub-nodes.
Examples - With Data
Node With City Data
Here I am with a City element.
Node With Person Data
Here I am with a Person element.
Node With Integer Data
Here I am with an Integer element.
Nulls
One Null
One sub-node may be null (either sub-node).
Two Nulls
Both sub-nodes may be null.
Data Structures And Algorithms (DSA) (Chapter 702 - Binary Search Tree (BST) Concepts)
Chapter 702 - Binary Search Tree (BST) Concepts
< Prev
What Is a BST Node?
Next >
Index
Video
Intro
Tree
Node
Operations
Traversal
Balance
Iterators
Design
Pros
Refs
Chapter
Top
Search Site
Contents