A community for students.
Here's the question you clicked on:
 0 viewing
anonymous
 3 years 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
anonymous
 3 years 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

anonymous
 3 years ago
Best ResponseYou've already chosen the best response.0@experimentX : hey can u pls help me out with this ?

anonymous
 3 years ago
Best ResponseYou've already chosen the best response.0do u know anyone online who does c++ ?

experimentX
 3 years ago
Best ResponseYou've already chosen the best response.0tell me roughly what are you trying to do ??

anonymous
 3 years ago
Best ResponseYou've already chosen the best response.0my 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

anonymous
 3 years ago
Best ResponseYou've already chosen the best response.0@ParthKohli : hey can u help me with this please ?

experimentX
 3 years ago
Best ResponseYou've already chosen the best response.0do you know what Regex is ??

experimentX
 3 years ago
Best ResponseYou've already chosen the best response.0yep .. use regex and use stack to keep track of structure.

anonymous
 3 years ago
Best ResponseYou've already chosen the best response.0but I am not allowed to use regex

anonymous
 3 years ago
Best ResponseYou've already chosen the best response.0@Callisto : any help on this ?

experimentX
 3 years ago
Best ResponseYou've already chosen the best response.0do you just want to sort them??

anonymous
 3 years ago
Best ResponseYou've already chosen the best response.0i counted it using maps and yea now i want to sort them in descending order of the count

anonymous
 3 years ago
Best ResponseYou've already chosen the best response.0@.Sam. : hey can help on this ?

anonymous
 3 years ago
Best ResponseYou've already chosen the best response.0@timo86m pls help me on this

experimentX
 3 years ago
Best ResponseYou've already chosen the best response.0make a list ... there are couple of sorting algorithms. describe roughly ... how are your attributes going to look ,

anonymous
 3 years ago
Best ResponseYou've already chosen the best response.0sorry dude i dont know that much yet :(

experimentX
 3 years ago
Best ResponseYou've already chosen the best response.0are you trying to sort them on the basis of their precedence or ?? like <head></head> comes first and <body></body> comes later??
Ask your own question
Sign UpFind 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
 Engagement 19 Mad Hatter
 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.