Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7592807
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T20:59:56+00:00 2026-05-30T20:59:56+00:00

this is a noobie question regarding tree maps. I have read through the Java

  • 0

this is a noobie question regarding tree maps. I have read through the Java API and other documentation but am still unclear about just how this works.

From my understanding, a Tree in java (or any language) is sort of like a family tree; where you have say:

Layer 1                               OldestGuy    
Layer 2       OldGuy1       Oldguy2         OldGuy3        OldGuy4           OldGuy5
Layer 3   Guy1 Guy2 Guy3 Guy4 Guy5  Guy6........ etc

Where Layer 1 has 1 value (i.e. a central node) and from there there can be arbitrary amounts of values (or Guys) in each subsequent layer, and some of the “branches” can be longer than others (for example it could go OldestGuy -> OldGuy1 -> Guy1 & Guy2…Guyn whilst at the same time another branch is just OldestGuy -> OldGuy4)

With this ind mind I am trying to add values to a TreeMap in specific locations of specific branches whilst making specific connections but all I seem to be getting is the same results as a HashMap.

(it seems what I want to do requires something more than the TreeMap ….as the Key (or Layer(?) would be the same for several different values)

Any suggestions / explanations would be fantastic because I feel as if I am seriously barking up the wrong tree with this one.

I have seen examples of this being done using googles .jar, (such as a family tree) but I am just trying to understand this as there seems to be lots of conflict between TreeMap and Trees and how you can store data in them.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T20:59:57+00:00Added an answer on May 30, 2026 at 8:59 pm

    TreeMap is just an implementation of Map that happens to use a red-black tree behind the scenes. The details of the tree aren’t exposed to you, so you can’t store elements in arbitrary locations.

    To put it another way, a TreeMap is not a general-purpose tree data structure. If that’s what you actually want, perhaps take a look at this Stack Overflow question: Java tree data-structure?.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This may be a very noobie question, but in today's world of web app
This is a noobie question, but I'm not sure how to pass by reference
Sorry if this sounds like a bit of a noobie question, i'm still relatively
Okay. This is propably very basic and noobie, but I have about 20+ stores
This may be a noobie questions, but... So I have a pyc file that
This might seem like a stupid question I admit. But I'm in a small
This is a difficult and open-ended question I know, but I thought I'd throw
This may actually show how much of a Noobie I am but does anyone
excuse what seems like a real noobie question but how can I implement the
I'm a MySQL query noobie so I'm sure this is a question with an

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.