Question: Solve the following question in C++ (Code has been provided) #include #include #include #include #include using std::vector; using std::string; string largest_number(vector a) { //write your

Solve the following question in C++ (Code has been provided)

Solve the following question in C++ (Code has been provided) #include #include

#include  #include  #include  #include  #include  using std::vector; using std::string; string largest_number(vector a) { //write your code here std::stringstream ret; for (size_t i = 0; i > result; return result; } int main() { int n; std::cin >> n; vector a(n); for (size_t i = 0; i > a[i]; } std::cout   Problem 2. [Camogory: Cating] We have discused the largest number problem in clase. Note that in the lecture we only have gingle digit. number, in this prohlem, we will implement n groody algorithm that will consider mumbers of multiple digits. For exiunple: Givea inpul auaters of andlliple digila: 4124345647 the laryest number ue can get by concatenate the input sexueree of numbers is:4745644342 1. Given input numbers of urultiple digits: 55257517532569581 ; what is the largest number you cium gel by coucalenate be impul sequebce ol mumbers? [2 points] Solution: The order of numbers you should piek is as follows: 53157569553252517 aud the largeet number in this is: 58157569553252517 1 2. Provide the peesiocode or an implementation for your greedy algorithm for this largest number problem with tmaltiple digits. [10 points]

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!