Question: Write a function BiasedSort that accepts a vector by reference and sorts the vector lexicographically, except that if the vector contains the string Me First,
Write a function BiasedSort that accepts a vector by reference and sorts the vector lexicographically, except that if the vector contains the string Me First, that string is always at the front of the sorted list. This may seem like a silly problem, but can come up in some circumstances. For example, if you have a list of songs in a music library, you might want songs with the title Untitled to always appear at the top.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
