The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | Apr 2017 |
| Last Sign in: | 327 Weeks Ago, 4 Days Ago |
| Questions Answered: | 12843 |
| Tutorials Posted: | 12834 |
MBA, Ph.D in Management
Harvard university
Feb-1997 - Aug-2003
Professor
Strayer University
Jan-2007 - Present
Write a void function named sort2 that takes two string parameters and sorts them. The function swaps the values of the string parameters if the 1st string is lexicographically greater than the 2nd string and otherwise leaves the strings unchanged. For example:
​
string s1 = "Orange";
string s2 = "Apple";
sort2(s1, s2);      // now s1 is “Apple" and s2 is "orange"
​
-----------