<s>
In	O
computer	B-General_Concept
science	I-General_Concept
,	O
a	O
2	B-Data_Structure
–	I-Data_Structure
3	I-Data_Structure
tree	I-Data_Structure
is	O
a	O
tree	B-Application
data	I-Application
structure	I-Application
,	O
where	O
every	O
node	B-Data_Structure
with	O
children	O
(	O
internal	O
node	B-Data_Structure
)	O
has	O
either	O
two	O
children	O
(	O
2-node	O
)	O
and	O
one	O
data	O
element	O
or	O
three	O
children	O
(	O
3-nodes	O
)	O
and	O
two	O
data	O
elements	O
.	O
</s>
<s>
A	O
2	B-Data_Structure
–	I-Data_Structure
3	I-Data_Structure
tree	I-Data_Structure
is	O
a	O
B-tree	B-Architecture
of	O
order	O
3	O
.	O
</s>
<s>
Nodes	O
on	O
the	O
outside	O
of	O
the	O
tree	O
(	O
leaf	B-Data_Structure
nodes	I-Data_Structure
)	O
have	O
no	O
children	O
and	O
one	O
or	O
two	O
data	O
elements	O
.	O
</s>
<s>
2	B-Data_Structure
–	I-Data_Structure
3	I-Data_Structure
trees	I-Data_Structure
were	O
invented	O
by	O
John	O
Hopcroft	O
in	O
1970	O
.	O
</s>
<s>
2	B-Data_Structure
–	I-Data_Structure
3	I-Data_Structure
trees	I-Data_Structure
are	O
required	O
to	O
be	O
balanced	O
,	O
meaning	O
that	O
each	O
leaf	O
is	O
at	O
the	O
same	O
level	O
.	O
</s>
<s>
It	O
follows	O
that	O
each	O
right	O
,	O
center	O
,	O
and	O
left	O
subtree	B-Application
of	O
a	O
node	B-Data_Structure
contains	O
the	O
same	O
or	O
close	O
to	O
the	O
same	O
amount	O
of	O
data	O
.	O
</s>
<s>
We	O
say	O
that	O
an	O
internal	O
node	B-Data_Structure
is	O
a	O
2-node	O
if	O
it	O
has	O
one	O
data	O
element	O
and	O
two	O
children	O
.	O
</s>
<s>
We	O
say	O
that	O
an	O
internal	O
node	B-Data_Structure
is	O
a	O
3-node	O
if	O
it	O
has	O
two	O
data	O
elements	O
and	O
three	O
children	O
.	O
</s>
<s>
A	O
4-node	O
,	O
with	O
three	O
data	O
elements	O
,	O
may	O
be	O
temporarily	O
created	O
during	O
manipulation	O
of	O
the	O
tree	O
but	O
is	O
never	O
persistently	O
stored	O
in	O
the	O
tree	O
.	O
</s>
<s>
We	O
say	O
that	O
is	O
a	O
2	B-Data_Structure
–	I-Data_Structure
3	I-Data_Structure
tree	I-Data_Structure
if	O
and	O
only	O
if	O
one	O
of	O
the	O
following	O
statements	O
hold	O
:	O
</s>
<s>
is	O
a	O
2-node	O
with	O
data	O
element	O
.	O
</s>
<s>
and	O
are	O
2	B-Data_Structure
–	I-Data_Structure
3	I-Data_Structure
trees	I-Data_Structure
of	O
the	O
same	O
height	O
;	O
</s>
<s>
is	O
a	O
3-node	O
with	O
data	O
elements	O
and	O
,	O
where	O
.	O
</s>
<s>
,	O
,	O
and	O
are	O
2	B-Data_Structure
–	I-Data_Structure
3	I-Data_Structure
trees	I-Data_Structure
of	O
equal	O
height	O
;	O
</s>
<s>
Every	O
internal	O
node	B-Data_Structure
is	O
a	O
2-node	O
or	O
a	O
3-node	O
.	O
</s>
<s>
Searching	O
for	O
an	O
item	O
in	O
a	O
2	B-Data_Structure
–	I-Data_Structure
3	I-Data_Structure
tree	I-Data_Structure
is	O
similar	O
to	O
searching	O
for	O
an	O
item	O
in	O
a	O
binary	B-Language
search	I-Language
tree	I-Language
.	O
</s>
<s>
Since	O
the	O
data	O
elements	O
in	O
each	O
node	B-Data_Structure
are	O
ordered	O
,	O
a	O
search	O
function	O
will	O
be	O
directed	O
to	O
the	O
correct	O
subtree	B-Application
and	O
eventually	O
to	O
the	O
correct	O
node	B-Data_Structure
which	O
contains	O
the	O
item	O
.	O
</s>
<s>
Let	O
be	O
a	O
2	B-Data_Structure
–	I-Data_Structure
3	I-Data_Structure
tree	I-Data_Structure
and	O
be	O
the	O
data	O
element	O
we	O
want	O
to	O
find	O
.	O
</s>
<s>
Suppose	O
is	O
a	O
2-node	O
with	O
left	O
child	O
and	O
right	O
child	O
.	O
</s>
<s>
If	O
,	O
then	O
set	O
to	O
,	O
which	O
by	O
definition	O
is	O
a	O
2	B-Data_Structure
–	I-Data_Structure
3	I-Data_Structure
tree	I-Data_Structure
,	O
and	O
go	O
back	O
to	O
step	O
2	O
.	O
</s>
<s>
Suppose	O
is	O
a	O
3-node	O
with	O
left	O
child	O
,	O
middle	O
child	O
,	O
and	O
right	O
child	O
.	O
</s>
<s>
To	O
insert	O
into	O
a	O
2-node	O
,	O
the	O
new	O
key	O
is	O
added	O
to	O
the	O
2-node	O
in	O
the	O
appropriate	O
order	O
.	O
</s>
<s>
To	O
insert	O
into	O
a	O
3-node	O
,	O
more	O
work	O
may	O
be	O
required	O
depending	O
on	O
the	O
location	O
of	O
the	O
3-node	O
.	O
</s>
<s>
If	O
the	O
tree	O
consists	O
only	O
of	O
a	O
3-node	O
,	O
the	O
node	B-Data_Structure
is	O
split	O
into	O
three	O
2-nodes	O
with	O
the	O
appropriate	O
keys	O
and	O
children	O
.	O
</s>
<s>
If	O
the	O
target	O
node	B-Data_Structure
is	O
a	O
3-node	O
whose	O
parent	O
is	O
a	O
2-node	O
,	O
the	O
key	O
is	O
inserted	O
into	O
the	O
3-node	O
to	O
create	O
a	O
temporary	O
4-node	O
.	O
</s>
<s>
In	O
the	O
illustration	O
,	O
the	O
key	O
10	O
is	O
inserted	O
into	O
the	O
2-node	O
with	O
6	O
and	O
9	O
.	O
</s>
<s>
The	O
middle	O
key	O
is	O
9	O
,	O
and	O
is	O
promoted	O
to	O
the	O
parent	O
2-node	O
.	O
</s>
<s>
This	O
leaves	O
a	O
3-node	O
of	O
6	O
and	O
10	O
,	O
which	O
is	O
split	O
to	O
be	O
two	O
2-nodes	O
held	O
as	O
children	O
of	O
the	O
parent	O
3-node	O
.	O
</s>
<s>
If	O
the	O
target	O
node	B-Data_Structure
is	O
a	O
3-node	O
and	O
the	O
parent	O
is	O
a	O
3-node	O
,	O
a	O
temporary	O
4-node	O
is	O
created	O
then	O
split	O
as	O
above	O
.	O
</s>
<s>
If	O
the	O
root	O
must	O
be	O
split	O
,	O
then	O
the	O
process	O
of	O
a	O
single	O
3-node	O
is	O
followed	O
:	O
a	O
temporary	O
4-node	O
root	O
is	O
split	O
into	O
three	O
2-nodes	O
,	O
one	O
of	O
which	O
is	O
considered	O
to	O
be	O
the	O
root	O
.	O
</s>
<s>
Since	O
2	B-Data_Structure
–	I-Data_Structure
3	I-Data_Structure
trees	I-Data_Structure
are	O
similar	O
in	O
structure	O
to	O
red	O
–	O
black	O
trees	O
,	O
parallel	O
algorithms	O
for	O
red	O
–	O
black	O
trees	O
can	O
be	O
applied	O
to	O
2	B-Data_Structure
–	I-Data_Structure
3	I-Data_Structure
trees	I-Data_Structure
as	O
well	O
.	O
</s>
