Answered step by step
Verified Expert Solution
Link Copied!

Question

00
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

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Entrepreneurship

Authors: Andrew Zacharakis, William D Bygrave

5th Edition

9781119563099

Students also viewed these Programming questions