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

  • Home
  • SEARCH
  • 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 8868763
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T17:20:21+00:00 2026-06-14T17:20:21+00:00

In many compilers, Standard data structures like Set , Map and Multimap use Red-Black-Trees

  • 0

In many compilers, Standard data structures like Set, Map and Multimap use Red-Black-Trees in behind, and a multimap stores multiple and duplicated keys.

I have a question about below quote:

“A red-black-tree stores keys uniquely and binds just one DataValue to
each key”

  1. Is above statement true?
  2. If that is true, How we can use a red-black-tree to implement a multimap (as C++ STL did)?
  • 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-06-14T17:20:22+00:00Added an answer on June 14, 2026 at 5:20 pm

    1) Nope, not true.

    2) Modifying a single mapping red black tree to map keys to multiple values would be trivial. It would just require using a second data structure and mapping key -> collection.

    For example, instead of mapping from a string to and int, you could map from a string to a vector of ints. Or a string to a linked list of ints. Or a string to a single-mapping RBT. So on :).


    Revisiting #1: Technically that would still be mapping a key to a single value, just the value wouldn’t be the directly mapped type. Depending on what you consider a “DataValue”, then yes, the statement is true.


    Also, the auxiliary data structure isn’t actually necessary; it just simplifies traversal. Basically to accommodate duplicates, instead of a strict less than/greater than relation between parent/left and parent/right, you have one of the sides also include equal.

    For example:

          5
       3     7
     3
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm starting to learn Haskell and I've heard that many Haskell compilers have especially
Looks like ExpressionTrees compiler should be near with the C# spec in many behaviors,
I have many structs (classes) and standalone functions that I like to compile separately
C99 still isn't supported by many compilers, and much of the focus is now
C11 supports anonymous structures, like so: struct Foo { struct { size_t x, y;
For a language like C++ the existence of a standard is a must. And
We are in evaluating technologies that we'll use to store data that we gather
My compiler errors are extremely long because g++ tells me the many 'candidates' for
I'm trying to compile many files using the Compiler API. Say I have a
If you compile a new version of compiler, how many times should you recompile

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.