Ask your own question, for FREE!
Computer Science 8 Online
OpenStudy (anonymous):

I have map of Attributes and to count the number of attributes present in my program(c++). for(std::map::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

OpenStudy (anonymous):

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

OpenStudy (experimentx):

i don't do c++ ...

OpenStudy (anonymous):

do u know anyone online who does c++ ?

OpenStudy (experimentx):

tell me roughly what are you trying to do ??

OpenStudy (anonymous):

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

OpenStudy (anonymous):

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

OpenStudy (experimentx):

do you know what Regex is ??

OpenStudy (anonymous):

kinda

OpenStudy (experimentx):

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

OpenStudy (anonymous):

but I am not allowed to use regex

OpenStudy (anonymous):

@Callisto : any help on this ?

OpenStudy (experimentx):

do you just want to sort them??

OpenStudy (anonymous):

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

OpenStudy (anonymous):

@.Sam. : hey can help on this ?

OpenStudy (anonymous):

@timo86m pls help me on this

OpenStudy (experimentx):

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

OpenStudy (anonymous):

sorry dude i dont know that much yet :(

OpenStudy (experimentx):

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

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!