Solved

TreeMap

Posted on 2011-09-07
2
286 Views
Last Modified: 2012-05-12
i would liek to know about TreeMap .

I read TreeMap

 based on the Red-Black tree data structure.


I a=was not clear on that. When, how , where we use it and we implememnt it.

Thanks in advance
0
Comment
Question by:gudii9
2 Comments
 
LVL 47

Accepted Solution

by:
for_yan earned 250 total points
ID: 36495763

http://www.jguru.com/faq/view.jsp?EID=981


Answer
A red-black tree is a binary search tree where every node has two children or is a leaf. It ensures O(log N) search times, at a cost of a more complicated insertion (and deletion) process. In a red-black tree, every node is colored either red or black, with a black root node, though a black root node isn't a requirement. In addition, if a node is red, its children must be black and every path from root to leaf (or null child node) must contain the same number of black nodes. These rather obscure rules ensure the tree is balanced.


0
 
LVL 7

Assisted Solution

by:rumi78
rumi78 earned 250 total points
ID: 36498238
TreeMap is Map implementation.

You use it when you want to have values ordered by key.

It means, when you iteratate map.values() it will be ordered.

rgds
rumi
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
couple of eclipse 5 36
servlet example 17 29
hibernate example for saving data 19 37
going to wrong jsp page 2 19
Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.

785 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question