Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

error: reference to non-static member function must be called Here is my code: #include #include #include using namespace std; class Solution { public : Solution(vector

error: reference to non-static member function must be

called

Here is my code:

#include  #include  #include  using namespace std; class Solution { public: Solution(vectorint,int>>); vectorint,int>> rallies; vectorint,int>> outputRallies(); bool strict_weak_ordering(pair<int,int>,pair<int,int>); }; Solution::Solution(vectorint,int>> _rallies) { rallies = _rallies; } bool Solution::strict_weak_ordering(pair<int, int> a,pair<int, int> b) { return a.second < b.second; } vectorint,int>> Solution::outputRallies() { std::vectorint,int>> schedule; unordered_map<int,int> hash; for(auto i = 0;i < rallies.size();i++){ hash.insert(make_pair(rallies[i].second,i)); } sort(rallies.begin(),rallies.end(),strict_weak_ordering);// <-- Reference to non static member function must be called 

 int x=0; for(auto j = 0;jint,int>::const_iterator got = hash.find(rallies[j].second); schedule.push_back(make_pair(got->second,x)); x += rallies[j].first; } return schedule; } I dont know what is worry with it,please help 

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored 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

Database Processing

Authors: David M. Kroenke

12th Edition International Edition

1292023422, 978-1292023427

More Books

Students also viewed these Databases questions

Question

Be familiar with the basic ways to manage capacity.

Answered: 1 week ago