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 6972717
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T17:00:25+00:00 2026-05-27T17:00:25+00:00

I need to convert a TreeMap to an array; could anyone show me how

  • 0

I need to convert a TreeMap to an array; could anyone show me how it’s done? I need both keys and values.I am mapping each word to its frequency in a text file

Here is output :

Bypass Internet Censorship.txt

{about=1, administrators=1, ago=1, and=1, around=1, asking=1, at=2, blocked=1, by=1, com=1, device=1, either=1, filtering=1, freerk=1, get=1, helps=1, hope=1, i=1, long=1, not=1, or=2, remember=1, school=1, sites=1, so=1, some=1, someone=1, that=1, the=1, this=1, to=1, view=1, was=1, ways=1, web=1, were=1, work=1, www=1, zensur=1}
  • 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-27T17:00:26+00:00Added an answer on May 27, 2026 at 5:00 pm
        StringBuilder temp=new StringBuilder();
    
        for(Map.Entry<String,Integer> entry : treeMap.entrySet()) 
        {
          String key = entry.getKey();
          Integer value = entry.getValue();
    
          temp.append(key).append(" = ").append(value).append(", ");
        }
    
        //TODO remove the last comma
    
    String result=temp.toString();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to convert full state name to its official state address code. For
I need to convert keys from type string to hash. The name of all
I need to convert values of type T into JsArray . For example, I
Need to convert pdf file to image file (jpg, png, gif) to show on
I need to convert values like 1393443048683555715 to HEX. But, first of all, i
I need to convert a StringBuffer Array to String Array for sorting. Is there
I need to convert one array structure into another array structure. I hope someone
I need to convert enum to dictionary and after that format each name (value)
I need convert this array data = [ #SHO 0x56, 0x0d, #CMD 0x1, 0x00,
Need to convert byte arrays of images and videos back to its origin. I

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.