Sort an array of strings based mostly on the frequency of excellent phrases in them


utilizing namespace std;

#outline F first

#outline S second

#outline MAX 26


bool cmp(const pair& a, const pair& b)



    if (a.F == b.F)

        return a.S < b.S;

    return a.F > b.F;


struct node ;


void add(string s, node* trie)


bool search(string s, node* trie)


void convert(string& str)


void sortArr(string good, vector& evaluate)





    node* trie = new node();

    string phrase;

    stringstream ss;

    ss << good;




    whereas (ss >> phrase)

        add(phrase, trie);

    int ok, n = evaluate.dimension();




    vector > score(n);

    for (int i = zero; i < n; i++)




    type(score.start(), score.finish(), cmp);



    for (int i = zero; i < n; i++)

        cout << evaluate[score[i].S] << "n";


int primary()