I am rather confused on interpreting this assignment. I am supposed to read "10 strings from cin, store it in a vector in a sorted order". The program has to "use a general BinarySearch function to find an appropriate insertion index".
Am I supposed to just read 10 strings, sort the strings, then store it in a vector? Then use the binarysearch on the sorted string to find the index?
Or am I supposed to read 10 strings, and use a general BinarySearch function to sort the strings? This seems rather implausible as I don't think a BinarySearch function is able to sort strings.
I just need a good grasp of what I am supposed to do, as it seems rather vague.
Repeat 10 times:
Read one string.
Use a binary search on the vector to find out where to insert the string just read.
Insert the string at that index.
End.