gudii9
asked on
passing 2D collection objects into 1D collection objects
when, where, how, why we need to passing 2D collection objects like hashmap, hashtable, properties into 1D collection objects like arraylist, vector, hasset, sorted set etc and reading back again. What are the practical uses, advantages, disadvanages of doing it.Any ideas, suggestions, sample code, links, source code highly appreciated. Thanks in advance
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Think of a tree as a set of roots for a tree.
As things get added to the tree they get added to one side or the other of the tree depending on where they fall between the existing nodes. If you delete a lot of nodes from one side of the tree roots, then it is like cutting of one set of branches of a tree. The tree no longer has the same number of nodes (branches/root branches) evenly spaced over a tree.
A similar thing happens when lots of additions occur between the keys that sit on one side of the tree. That side of the tree becomes unbalanced and a tree search needs to descend further nodes to find the correct key value. This slows down the performance of a tree.
Most tree algorithms will have a capacity to rebalance, some automatically, some manually to adjust the nodes of the tree back to something approximating equality.
As things get added to the tree they get added to one side or the other of the tree depending on where they fall between the existing nodes. If you delete a lot of nodes from one side of the tree roots, then it is like cutting of one set of branches of a tree. The tree no longer has the same number of nodes (branches/root branches) evenly spaced over a tree.
A similar thing happens when lots of additions occur between the keys that sit on one side of the tree. That side of the tree becomes unbalanced and a tree search needs to descend further nodes to find the correct key value. This slows down the performance of a tree.
Most tree algorithms will have a capacity to rebalance, some automatically, some manually to adjust the nodes of the tree back to something approximating equality.
ASKER
can you please elaborate on above point. I am not clear on that.