Question: In c++, write a function (named sort_words) that takes an array of strings and returns a vector of sorted strings. sort_words only takes one argument,

In c++, write a function (named "sort_words") that takes an array of strings and returns a vector of sorted strings. sort_words only takes one argument, the array of strings.

Example usage:

#include  using std::string; #include  using std::vector; string words[] = {"cat", "ant", "dog"}; vector result = sort_words(words); vector expected = {"ant", "cat", "dog"}; expected == result; // Should be true 

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!