<s>
In	O
computer	O
science	O
,	O
a	O
randomized	B-Application
meldable	I-Application
heap	I-Application
(	O
also	O
Meldable	O
Heap	B-Application
or	O
Randomized	O
Meldable	O
Priority	B-Application
Queue	I-Application
)	O
is	O
a	O
priority	B-Application
queue	I-Application
based	O
data	B-General_Concept
structure	I-General_Concept
in	O
which	O
the	O
underlying	O
structure	O
is	O
also	O
a	O
heap-ordered	O
binary	O
tree	O
.	O
</s>
<s>
This	O
approach	O
has	O
a	O
number	O
of	O
advantages	O
over	O
similar	O
data	B-General_Concept
structures	I-General_Concept
.	O
</s>
<s>
It	O
offers	O
greater	O
simplicity	O
:	O
all	O
operations	O
for	O
the	O
randomized	B-Application
meldable	I-Application
heap	I-Application
are	O
easy	O
to	O
implement	O
and	O
the	O
constant	O
factors	O
in	O
their	O
complexity	O
bounds	O
are	O
small	O
.	O
</s>
<s>
The	O
randomized	B-Application
meldable	I-Application
heap	I-Application
supports	O
a	O
number	O
of	O
common	O
operations	O
.	O
</s>
<s>
The	O
insertion	O
and	O
deletion	O
operations	O
are	O
implemented	O
in	O
terms	O
of	O
an	O
additional	O
operation	O
specific	O
to	O
the	O
meldable	O
heap	B-Application
,	O
Meld(Q1, Q2 )	O
.	O
</s>
<s>
The	O
basic	O
goal	O
of	O
the	O
meld	O
(	O
also	O
called	O
merge	O
)	O
operation	O
is	O
to	O
take	O
two	O
heaps	B-Application
(	O
by	O
taking	O
each	O
heaps	B-Application
root	O
nodes	O
)	O
,	O
Q1	O
and	O
Q2	O
,	O
and	O
merges	O
them	O
,	O
returning	O
a	O
single	O
heap	B-Application
node	O
as	O
a	O
result	O
.	O
</s>
<s>
This	O
heap	B-Application
node	O
is	O
the	O
root	O
node	O
of	O
a	O
heap	B-Application
containing	O
all	O
elements	O
from	O
the	O
two	O
subtrees	O
rooted	O
at	O
Q1	O
and	O
Q2	O
.	O
</s>
<s>
If	O
either	O
heaps	B-Application
are	O
null	O
,	O
then	O
the	O
merge	O
is	O
taking	O
place	O
with	O
an	O
empty	O
set	O
and	O
the	O
method	O
simply	O
returns	O
the	O
root	O
node	O
of	O
the	O
non-empty	O
heap	B-Application
.	O
</s>
<s>
It	O
is	O
therefore	O
ensured	O
that	O
Q1	O
<	O
Q2	O
and	O
that	O
the	O
root	O
node	O
of	O
the	O
merged	O
heap	B-Application
will	O
contain	O
Q1	O
.	O
</s>
<s>
With	O
the	O
meld	O
operation	O
complete	O
,	O
inserting	O
into	O
the	O
meldable	O
heap	B-Application
is	O
easy	O
.	O
</s>
<s>
This	O
new	O
node	O
is	O
then	O
simply	O
melded	O
with	O
the	O
heaps	B-Application
root	O
node	O
.	O
</s>
<s>
Similarly	O
easy	O
to	O
the	O
insert	O
operation	O
,	O
Remove( )	O
uses	O
the	O
Meld	O
operation	O
to	O
eliminate	O
the	O
root	O
node	O
from	O
the	O
heap	B-Application
.	O
</s>
<s>
Possibly	O
the	O
easiest	O
operation	O
for	O
the	O
randomized	B-Application
meldable	I-Application
heap	I-Application
,	O
FindMin( )	O
simply	O
returns	O
the	O
element	O
currently	O
stored	O
in	O
the	O
heap	B-Application
's	O
root	O
node	O
.	O
</s>
<s>
Some	O
additional	O
operations	O
that	O
can	O
be	O
implemented	O
for	O
the	O
meldable	O
heap	B-Application
that	O
also	O
have	O
O(logn )	O
worst-case	O
efficiency	O
are	O
:	O
</s>
<s>
Remove(u )	O
-	O
Remove	O
the	O
node	O
u	O
and	O
its	O
key	O
from	O
the	O
heap	B-Application
.	O
</s>
<s>
Absorb(Q )	O
-	O
Add	O
all	O
elements	O
of	O
the	O
meldable	O
heap	B-Application
Q	O
to	O
this	O
heap	B-Application
,	O
emptying	O
Q	O
in	O
the	O
process	O
.	O
</s>
<s>
As	O
all	O
non-constant-time	O
operations	O
are	O
defined	O
in	O
terms	O
of	O
the	O
Meld	O
operation	O
,	O
the	O
efficiency	O
of	O
these	O
operations	O
can	O
be	O
determined	O
through	O
analysis	O
of	O
the	O
complexity	O
of	O
melding	O
two	O
randomized	O
heaps	B-Application
.	O
</s>
<s>
The	O
result	O
of	O
this	O
analysis	O
is	O
that	O
the	O
expected	O
time	O
of	O
any	O
meldable	O
priority	B-Application
queue	I-Application
operation	O
on	O
a	O
n-node	O
randomized	O
heap	B-Application
is	O
O(logn )	O
.	O
</s>
<s>
The	O
meldable	O
heap	B-Application
appears	O
to	O
have	O
first	O
been	O
proposed	O
in	O
1998	O
by	O
Gambin	O
and	O
Malinowski	O
.	O
</s>
<s>
While	O
the	O
randomized	B-Application
meldable	I-Application
heap	I-Application
is	O
the	O
simplest	O
form	O
of	O
a	O
meldable	O
heap	B-Application
implementation	O
,	O
others	O
do	O
exist	O
.	O
</s>
