Discussion:
interchangeWithLeader?
(too old to reply)
Chuck Lucier
2005-09-29 00:50:42 UTC
Permalink
what leader are we swapping with the node at the specified index being
passed as a parameter? Is the leader going to be a leaf and is the index
given also a leaf? Are we switching nodes that have the same weight? What's
the point to having this method? Is it supposed to be where a node gets
incremented greater than it's siblings it has to find the last node that's
less than it and swap them? My partner and I are kind of lost if some one
could be so kind and clear this up for us please!
Alan
2005-09-29 03:33:35 UTC
Permalink
interchangeWithLeader switches the current node with the highest index node
of the same weight (and its children).

My question is this: When we swap the nodes, do we still have to swap their
children, or is that takes care of itself in the swap? If not, any idea on
how to get started swapping the children as well?

Thanks!

~Alan
Post by Chuck Lucier
what leader are we swapping with the node at the specified index being
passed as a parameter? Is the leader going to be a leaf and is the index
given also a leaf? Are we switching nodes that have the same weight?
What's the point to having this method? Is it supposed to be where a node
gets incremented greater than it's siblings it has to find the last node
that's less than it and swap them? My partner and I are kind of lost if
some one could be so kind and clear this up for us please!
Loading...