Question: Please help .cpp file that implements the methods and specifications provided.The trendtracker.cpp which implements the methods in trendtracker.h should pass all the tests given in

Please help .cpp file that implements the methods and specifications provided.The trendtracker.cpp which implements the methods in trendtracker.h should pass all the tests given in main.cpp, PLEASE NOTE THIS ONE REQUIRES USING A TWO_VECTOR BASED DATA STRUCTURE AND AS SUCH IS DIFFERENT THEN ALL THE OTHER SIMILAR QUESTIONS HERE ON CHEGG, DONT COPY AND PASTE THOSE ANSWERS AS THEY ARE ALL WRONG!!! THANK YOU Create a new C++ source file named trendtracker.cpp that implements the Trendtracker class using an efficient two-vector-based data structure Please help .cpp file that implements the methods and specifications provided.The trendtracker.cpp The following files have been given to you: 1. A C++ header file (trendtracker.h) declaring the Trendtracker class. 2. A C++ source file (main.cpp) containing a main function with tests. 3. A text file (tiny.txt) containing 1 hashtag. 4. A text file (small.txt) containing 4 hashtags. 5. A text file (hashtags.txt) containing 300000 hashtags. 6. A text file (tweeted.txt) containing 1500000 hashtags. /////////////////////////////////////////////////////////////////////////////////// 

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

//trendtracker.cpp

#include "trendtracker.h"

#include

using namespace std;

// Creates a Trendtracker containing hashtags

// found in the provided file.

// The file is promised to have the following format:

//

// string1

// string2

// ...

// stringN

//

// where string1

//

// Must run in O(n) time.

Trendtracker(string filename)

{

}

// Return the number of hashtags in the Trendtracker.

//

// Must run in O(1) time.

int size()

{

}

// Optional helper method.

// Returns the index of E containing an Entry with hashtag ht.

// If no such hashtag is found, returns -1.

//

// Should run in O(log(n)).

int search(string ht)

{

}

// Adds 1 to the total number times a hashtag has been tweeted.

// If the hashtag does not exist in TrendTracker, does nothing.

//

// Must run in O(log(n)) time.

void Trendtracker::tweeted(string ht)

{

}

// Returns the number of times a hashtag has been tweeted.

// If the hashtag does not exist in Trendtracker, returns -1.

//

// Must run in O(log(n)) time.

int Trendtracker::popularity(string name)

{

}

// Returns a most-tweeted hashtag.

// If the Trendtracker has no hashtags, returns "".

//

// Must run in O(1) time.

string Trendtracker::top_trend()

{

}

// Fills the provided vector with the 3 most-tweeted hashtags,

// in order from most-tweeted to least-tweeted.

//

// If there are fewer than 3 hashtags, then the vector is filled

// with all hashtags (in most-tweeted to least-tweeted order).

//

// Must run in O(1) time.

void Trendtracker::top_three_trends(vector& T)

{

}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

//trendtracker.h #ifndef TRENDTRACKER_H #define TRENDTRACKER_H #include #include #include #include using namespace std; class Trendtracker { // For the mandatory running times below: // n is the number of hashtags in the Trendtracker. public: // Creates a Trendtracker containing hashtags // found in the provided file. // The file is promised to have the following format: // // string1 // string2 // ... // stringN // // where string1  

/////////////////////////////////////////////////////////////////////////////////////////////////////////////

main.cpp

#include #include #include #include #include #include "trendtracker.h" using namespace std; inline void _test(const char* expression, const char* file, int line) { cerr  

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

//tiny.text

#solo

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

//small.txt

#C++ #algorithms #cs4all #programming

////////////////////////////////////////////////////////////////////////////////////////////////////////////////

//tweeted.txt can be found below

/ /http://andrewwinslow.com/3333/hwTT2/tweeted.txt

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

//hashtags.txt can be dowloaded below

// http://andrewwinslow.com/3333/hwTT2/hashtags.txt

vector S 4 | 1 5 string hashtag E int pop #adsl #big | #cat | #dogl #eggl #fad | #gig | #hot vector Figure 1: Representing hashtags and their popularities using an efficient vector-based data structure. vector S 4 | 1 5 string hashtag E int pop #adsl #big | #cat | #dogl #eggl #fad | #gig | #hot vector Figure 1: Representing hashtags and their popularities using an efficient vector-based data structure

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!