Quantcast

A community for students. Sign up today!

Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing

Living_dreams

  • one year ago

I have map of Attributes and to count the number of attributes present in my program(c++). for(std::map<string, int>::iterator it = Attribute.begin(); it != Attribute.end(); ++it) cout << it->first << ": " << it->second << endl; I use a for loop to print it out with the number of count. But now I want to sort the the count of attributes in descending order n I am not able to think how ? Can some one please help me

  • This Question is Closed
  1. Living_dreams
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 0

    @experimentX : hey can u pls help me out with this ?

  2. experimentX
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 0

    i don't do c++ ...

  3. Living_dreams
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 0

    do u know anyone online who does c++ ?

  4. experimentX
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 0

    tell me roughly what are you trying to do ??

  5. Living_dreams
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 0

    my program is to read an HTML code and do couple of things and oe of them is to count the attributes in the HTML code and sort them in descending order I counted the attributes using maps but now i dnt kn how to sort them

  6. Living_dreams
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 0

    @ParthKohli : hey can u help me with this please ?

  7. experimentX
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 0

    do you know what Regex is ??

  8. Living_dreams
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 0

    kinda

  9. experimentX
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 0

    yep .. use regex and use stack to keep track of structure.

  10. Living_dreams
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 0

    but I am not allowed to use regex

  11. Living_dreams
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 0

    @Callisto : any help on this ?

  12. experimentX
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 0

    do you just want to sort them??

  13. Living_dreams
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 0

    i counted it using maps and yea now i want to sort them in descending order of the count

  14. Living_dreams
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 0

    @.Sam. : hey can help on this ?

  15. Living_dreams
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 0

    @timo86m pls help me on this

  16. experimentX
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 0

    make a list ... there are couple of sorting algorithms. describe roughly ... how are your attributes going to look ,

  17. timo86m
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 0

    sorry dude i dont know that much yet :(

  18. experimentX
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 0

    are you trying to sort them on the basis of their precedence or ?? like <head></head> comes first and <body></body> comes later??

  19. Not the answer you are looking for?
    Search for more explanations.

    Search OpenStudy
    • Attachments:

Ask your own question

Ask a Question
Find more explanations on OpenStudy

Your question is ready. Sign up for free to start getting answers.

spraguer (Moderator)
5 → View Detailed Profile

is replying to Can someone tell me what button the professor is hitting...

23

  • Teamwork 19 Teammate
  • Problem Solving 19 Hero
  • You have blocked this person.
  • ✔ You're a fan Checking fan status...

Thanks for being so helpful in mathematics. If you are getting quality help, make sure you spread the word about OpenStudy.

This is the testimonial you wrote.
You haven't written a testimonial for Owlfred.