Answered step by step
Verified Expert Solution
Question
1 Approved Answer
C++ How to sort vector of tuples in a specific way. I have a vector of tuple to specify : vector>,string,string,int,double> Sorting should be accordingly:
C++ How to sort vector of tuples in a specific way.
I have a vector of tuple to specify : vector>,string,string,int,double>
Sorting should be accordingly:
1. if the 3rd argument of the tuple(string) is equal to a specific type string like "computer", sort it accordingly.
2. if the 5th argument of the tuple(double) is smaller than the other tuples with the specific 3rd argument string type, sort it accordingly.
So it should be sorted accordingly for the 3rd and 5th arguments.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started