Top 3 elements in the vector

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ASAXE
    New Member
    • Jun 2007
    • 2

    #1

    Top 3 elements in the vector

    I am parsing a sentence for tokens and storing them in a vector. I would like to use STL for finding out the top 3 tokens (length based) extracted and stored in my vector. Tokens of the same length will be counted as one category. I also need to print the equal sized tokens in the order they were extracted.

    Please let me know a short and concise way to do this.
    Last edited by ASAXE; Jul 11 '07, 12:26 PM. Reason: Mistake
  • sicarie
    Recognized Expert Specialist
    • Nov 2006
    • 4677

    #2
    Originally posted by ASAXE
    I am parsing a sentence for tokens and storing them in a vector. I would like to use STL for finding out the top 3 tokens (length based) extracted and stored in my vector. Tokens of the same length will be counted as one category. I also need to print the equal sized tokens in the order they were extracted.

    Please let me know a short and concise way to do this.
    It looks like you are already set on a way to do this. Is there a specific issue you're having difficulty with on this?

    Comment

    Working...