Transmission Control Protocol Tcp Detects Packet Loss Performs Retransmissions Ensure Reli Q43900960

Why do Transmission Control Protocol (TCP) detects packet lossand performs retransmissions to ensure reliable messaging and avoidcongestion/

Expert Answer


Answer to Why do Transmission Control Protocol (TCP) detects packet loss and performs retransmissions to ensure reliable messaging…

Transmitting Rectangular Shaped Pulses Bandlimited Channel Causes Isi Quantify Phenomena U Q43785668

Transmitting rectangular shaped pulses through a bandlimitedchannel causes ISI. Quantify this phenomena using appropriatemathematical derivations.

Expert Answer


Answer to Transmitting rectangular shaped pulses through a bandlimited channel causes ISI. Quantify this phenomena using appropria…

Transpose Matrix Operation Given 0 N J 0 J N J Output J Input J Plot Memory Access Functio Q43823515

Transpose of a matrix operation is given below: for (i = 0; i < n; i++) { for (j = 0; j < n; j++) { output[j][i] = input[i][j

Transpose of a matrix operation is given below: for (i = 0; i < n; i++) { for (j = 0; j < n; j++) { output[j][i] = input[i][j]; Plot the memory access as a function of time in the following figure and comment on its data locality. How can one improve the performance of this code segment? Show transcribed image text Transpose of a matrix operation is given below: for (i = 0; i

Expert Answer


Answer to Transpose of a matrix operation is given below: for (i = 0; i < n; i++) { for (j = 0; j < n; j++) { output[j][i] = input...

Trendtrackercpp Fills Provided Vector K Tweeted Hashtags Order Tweeted Least Tweeted Fewer Q43896670

//trendtracker.cpp

// Fills the provided vector with the k most-tweetedhashtags,
// in order from most-tweeted to least-tweeted.
//
// If there are fewer than k hashtags, then the vector isfilled
// with all hashtags (in most-tweeted to least-tweetedorder).
//
// Must run in O(nk) time.
void Trendtracker::top_k_trends(vector<string> &T, intk){}

Can I get help with solving this Function?

//trendtracker.h

#ifndef TRENDTRACKER_H
#define TRENDTRACKER_H

#include <vector>
#include <string>

using namespace std;

class Trendtracker
{
   // For the mandatory running times below:
   // n is the number of hashtags in theTrendtracker.

public:
   // Creates a new Trendtracker tracking nohashtags.
   //
   // Must run in O(1) time.
   Trendtracker();

   // Inserts a hashtag (tweeted 0 times) into theTrendtracker.
   // If the hashtag already is in Trendtracker, doesnothing.
   //
   // Must run in O(n) time.
   void insert(string ht);

   // Return the number of hashtags in theTrendtracker.
   //
   // Must run in O(1) time.
   int size();

   // Adds 1 to the total number times a hashtag hasbeen tweeted.
   // If the hashtag does not exist in TrendTracker, doesnothing.
   //
   // Must run in O(n) time.
   void tweeted(string ht);

   // Returns the number of times a hashtag has beentweeted.
   // If the hashtag does not exist in Trendtracker,returns -1.
   //
   // Must run in O(n) time.
   int popularity(string name);

   // Returns a most-tweeted hashtag.
   // If the Trendtracker has no hashtags, returns””.
   //
   // Must run in O(n) time.
   string top_trend();

   // Fills the provided vector with the 3most-tweeted hashtags,
   // in order from most-tweeted to least-tweeted.
   //
   // If there are fewer than 3 hashtags, then the vectoris filled
   // with all hashtags (in most-tweeted to least-tweetedorder).
   //
   // Must run in O(n) time.
   void top_three_trends(vector<string>&T);

   // Fills the provided vector with the kmost-tweeted hashtags,
   // in order from most-tweeted to least-tweeted.
   //
   // If there are fewer than k hashtags, then the vectoris filled
   // with all hashtags (in most-tweeted to least-tweetedorder).
   //
   // Must run in O(nk) time.
   void top_k_trends(vector<string> &T, intk);

private:
   // A simple class representing a hashtag and
   // the number of times it has been tweeted.
   class Entry
   {
   public:
       string hashtag;
       int pop;
   };

   // Entries containing each hashtag and itspopularity.
   vector<Entry> E;
};

#endif

Expert Answer


Answer to //trendtracker.cpp // Fills the provided vector with the k most-tweeted hashtags, // in order from most-tweeted to least…

Trendtrackerh Class Trendtracker Public Fills Provided Vector K Tweeted Hashtags Order Twe Q43898413

//trendtracker.h

class Trendtracker{

public:

// Fills the provided vector with the k most-tweetedhashtags,
   // in order from most-tweeted to least-tweeted.
   //
   // If there are fewer than k hashtags, then the vectoris filled
   // with all hashtags (in most-tweeted to least-tweetedorder).
   //
   // Must run in O(nk) time.
   void top_k_trends(vector<string> &T, intk);

private:
   // A simple class representing a hashtag and
   // the number of times it has been tweeted.
   class Entry
   {
   public:
       string hashtag;
       int pop;
   };

   // Entries containing each hashtag and itspopularity.
   vector<Entry> E;
};

Need help on completing this function

//trendtracker.cpp

void Trendtracker::top_k_trends(vector<string> &T, intk){}

Tests for top_k_trends()

//main.cpp

#include <cassert>
#include <fstream>
#include <iostream>
#include <cstdlib>
#include <string>
#include “trendtracker.h”

//Test top_k_trends
   string weird = “#”;
   for (int i = ‘a’; i <= ‘z’; i++)
   {
       for (int j = ‘a’; j <= ‘z’;j++)
       {
           weird +=i;
           weird +=j;
           for (int i = 0;i < 3 * (weird[1] – ‘a’) + (weird[2] – ‘a’); i++)
              T4.tweeted(weird);
           weird =”#”;
       }
   }

   T4.top_k_trends(R, 50);

   test(R[2] == “#up”);
   test(R[5] == “#so”);
   test(R[10] == “#ok”);
   test(R[15] == “#me”);
   test(R[29] == “#finishing”);
   test(R[32] == “#quieting”);

Expert Answer


Answer to //trendtracker.h class Trendtracker{ public: // Fills the provided vector with the k most-tweeted hashtags, // in order …

Trendtrackerh Ifndef Trendtrackerh Define Trendtrackerh Include Include Using Namespace St Q43884847

//trendtracker.h
#ifndef TRENDTRACKER_H
#define TRENDTRACKER_H

#include <vector>
#include <string>

using namespace std;

class Trendtracker
{

public:
   Trendtracker();
  

void insert(string ht);

   int size();

  
   void tweeted(string ht);

   int popularity(string name);

   string top_trend();

   void top_three_trends(vector<string>&T);

   void top_k_trends(vector<string> &T, intk);

private:

   class Entry
   {
   public:
       string hashtag;
       int pop;
   };

vector<Entry> E;
};

#endif

//trendtracker.cpp

#include”trendtracker.h”
using namespace std;

// Creates a new Trendtracker tracking no hashtags.
//
// Must run in O(1) time.
Trendtracker::Trendtracker(){

}

// Inserts a hashtag (tweeted 0 times) into theTrendtracker.
// If the hashtag already is in Trendtracker, does nothing.
//
// Must run in O(n) time.
void Trendtracker::insert(string ht){
   Entry t;
   int n = E.size();
   t.hashtag = ht;
   t.pop = 0;
  
   for (int i = 0; i < n; i++) {
       if (ht == E[i].hashtag) {
           break;
       }
   }
}

// Return the number of hashtags in the Trendtracker.
//
// Must run in O(1) time.
int Trendtracker::size(){
   return E.size();
}

// Adds 1 to the total number times a hashtag has beentweeted.
// If the hashtag does not exist in TrendTracker, doesnothing.
//
// Must run in O(n) time.
void Trendtracker::tweeted(string ht) {
   int n = E.size();
   for (int i = 0; i < n; i++) {
       if (E[i].hashtag == ht) {
          E[i].pop++;
       }
   }
}

// Returns the number of times a hashtag has been tweeted.
// If the hashtag does not exist in Trendtracker, returns -1.
//
// Must run in O(n) time.
int Trendtracker::popularity(string name){
   int i = 0;
   int n = E.size();
   bool check = 0;

   for (int i = 0; i < n; i++) {
       if (name == E[i].hashtag) {
           check = 1;
       }
   }

   if (check == 1) {
       return E[i].pop;
   }
   else {
       return -1;
   }
}

// Returns a most-tweeted hashtag.
// If the Trendtracker has no hashtags, returns “”.
//
// Must run in O(n) time.
string Trendtracker::top_trend(){
   if (E.size() == 0) {
       return “”;
   }
  
   int popular;
   for (int i = 0, n = E.size(), popular = 0; i < n;i++) {
       if (E[i].pop > E[popular].pop){
           popular =i;
       }
   }
   return E[popular].hashtag;

}

// Fills the provided vector with the 3 most-tweetedhashtags,
// in order from most-tweeted to least-tweeted.
//
// If there are fewer than 3 hashtags, then the vector isfilled
// with all hashtags (in most-tweeted to least-tweetedorder).
//
// Must run in O(n) time.
void Trendtracker::top_three_trends(vector<string>&T){
  
   int f, s, t;
   int n = E.size();
   for (int i = 0, f = s = t = n; i < n; i++) {
       if (E[i].pop > E[f].pop) {
           t = s;
           s = f;
           f = i;
       }
       else if (E[i].pop > E[s].pop){
           t = s;
           s = i;
       }
       else if(E[i].pop > E[t].pop){
           t = i;
       }
   }

   T.push_back(E[f].hashtag);
   if (s != n && s != f)
       T.push_back(E[s].hashtag);
   if (t != n && t != s)
       T.push_back(E[t].hashtag);
  
}

// Fills the provided vector with the k most-tweetedhashtags,
// in order from most-tweeted to least-tweeted.
//
// If there are fewer than k hashtags, then the vector isfilled
// with all hashtags (in most-tweeted to least-tweetedorder).
//
// Must run in O(nk) time.
void Trendtracker::top_k_trends(vector<string> &T, intk){}

canyou help me figure out how to solve whatever code i dont havecompleted in trendtracker.cpp

Expert Answer


Answer to //trendtracker.h #ifndef TRENDTRACKER_H #define TRENDTRACKER_H #include #include using namespace std; class Trendtracke…

Tries Question C Given Prefix Find Number Words Full Prefix Struct Trienode Struct Tries C Q43826784

Tries Question in C

given a prefix , find number of words with that full prefix

struct trieNode {

struct tries *children[26]

int flag;

int NumberOfWords;

}

int findTotal(tries* root, char* prefix)

{

if ( root == NULL)

return 0;

}

Expert Answer


Answer to Tries Question in C given a prefix , find number of words with that full prefix struct trieNode { struct tries *children…

Trouble Beginner Program Main Function 3 Program Also Another Function Called Roundfunct F Q43833592

I am having trouble with this as I am a beginner:

This program should have a main function.
3. The program should also have another function called“RoundFunct”and this function should round up or round down a double value toan integer value.
4. Rules: Cannot use round function

  • For positive values
    • Round up a value if its fraction part is greater or equal to“.5”
    • Round down a value if its fraction part is less than “.5”
  • For negative values
    • Round down a value if its fraction part is greater or equal to“.5”
    • Round up a value if its fraction part is less than “.5”

5. Examples

  • 0.4 should be rounded down to 0
  • 0.6 should be rounded up to 1
  • -0.4 should be rounded up to 0
  • -0.6 should be rounded down to -1

Expert Answer


Answer to I am having trouble with this as I am a beginner: This program should have a main function. 3. The program should also h…

Trouble Getting Radio Button Turn Modifypartcontroller Wrote Code Similar Addpart Controll Q43803771

I am having trouble getting the radio button to turn on in themodifypartcontroller. I wrote the code similar to to AddPartController and works fine when adding the part to the inventorysystem. But when I go to update the selected part, it grays out,not allowing me to update type of part. Any suggestions?

Source History -97529 PBB O W- public class ModifyPartController implements Initializable { FXML private Label modifyPartSour

MODIFY PART IN HOUSE OUTSOURCED AUTO GENERATE NAME PART NAME INVENTORY INVENTORY PRICE / COST PRICE / COST MAX MAX Min MIN CO

Source History -97529 PBB O W- public class ModifyPartController implements Initializable { FXML private Label modifyPartSourceLabel; FXML private TextField modifyPartMax; FXML private TextField modifyPartMin; FXML private TextField modifyPartName; FXML private TextField modify Part Source: FXML private TextField modify PartPrice; FXML private TextField modify Part Inventory; @FXML private TextField modify PartID; FXML private RadioButton modifyPartinHouseSourced; FXML private RadioButton modifyPartout SourcedFromCompany; FXML private Button modifyPartSave; FXML private void updateinHouseSourcedPart (ActionEvent event) { updateinHouseSourcedPart(); 53 @ FXML private void modifyPartout SourcedFromCompany (ActionEvent event) { modify Part SourceLabel.setText (“Company Name.”); private void updateinHouseSourcedPart() { partIsout SourcedFromCompany = false; modify Partout SourcedFromCompany.setSelected(false); modify PartinHouse Sourced.setSelected (true); modifyPart SourceLabel.setText (“Machine ID”); modifyPart Source.setPrompt Text (“Machine ID”); 66 @FXML private void updateoutsourcedFromCompanyPart (ActionEvent event) { Output – Inventory Management System 3000 (jfxsa-run) X MODIFY PART IN HOUSE OUTSOURCED AUTO GENERATE NAME PART NAME INVENTORY INVENTORY PRICE / COST PRICE / COST MAX MAX Min MIN COMPANY NAME COMPANY NAME SAVE CANCEL Show transcribed image text Source History -97529 PBB O W- public class ModifyPartController implements Initializable { FXML private Label modifyPartSourceLabel; FXML private TextField modifyPartMax; FXML private TextField modifyPartMin; FXML private TextField modifyPartName; FXML private TextField modify Part Source: FXML private TextField modify PartPrice; FXML private TextField modify Part Inventory; @FXML private TextField modify PartID; FXML private RadioButton modifyPartinHouseSourced; FXML private RadioButton modifyPartout SourcedFromCompany; FXML private Button modifyPartSave; FXML private void updateinHouseSourcedPart (ActionEvent event) { updateinHouseSourcedPart(); 53 @ FXML private void modifyPartout SourcedFromCompany (ActionEvent event) { modify Part SourceLabel.setText (“Company Name.”); private void updateinHouseSourcedPart() { partIsout SourcedFromCompany = false; modify Partout SourcedFromCompany.setSelected(false); modify PartinHouse Sourced.setSelected (true); modifyPart SourceLabel.setText (“Machine ID”); modifyPart Source.setPrompt Text (“Machine ID”); 66 @FXML private void updateoutsourcedFromCompanyPart (ActionEvent event) { Output – Inventory Management System 3000 (jfxsa-run) X
MODIFY PART IN HOUSE OUTSOURCED AUTO GENERATE NAME PART NAME INVENTORY INVENTORY PRICE / COST PRICE / COST MAX MAX Min MIN COMPANY NAME COMPANY NAME SAVE CANCEL

Expert Answer


Answer to I am having trouble getting the radio button to turn on in the modifypartcontroller. I wrote the code similar to to AddP…

Trouble Getting Raiseamount Newsalary Display Debugging Showed Issues Program Confused Get Q43779853

I am having some trouble with getting the RaiseAmount andNewSalary to display, debugging showed no issues with the programbut just confused on how to get the correct values to display tothe user.

#include <iostream> using namespace std; Oint main() //Declare variables and constants double CurrentSalary = 0; double RaiseRaise = .07; else if (50000.00 <= CurrentSalary <= 99999.99), { Raise = .10; else if (CurrentSalary >= 100000.00) i Raise = .

#include <iostream>
using namespace std;

int main()
{
    //Declare variables and constants
    double CurrentSalary = 0;
    double Raise = 0;
    int RaiseAmount = 0;
    int NewSalary = 0;

    //Prompt the user for current salaryinput
    cout << “Enter current salary: “;
    cin >> CurrentSalary;

    //Deciding what percentage raise for newsalary based on current salary

    if (CurrentSalary <= 14999.99)
    {
        Raise = .05;
    }
    else
        if (15000.00 <=CurrentSalary <= 49999.99)
        {
           Raise = .07;
        }
        else
           if (50000.00 <= CurrentSalary <= 99999.99)
           {
               Raise = .10;
           }
           else
               if (CurrentSalary >= 100000.00)
               {
                   Raise = .15;
               }

    //Display the Raise amount and the newsalary
    RaiseAmount = CurrentSalary * Raise;
    cout << RaiseAmount;

    NewSalary = CurrentSalary *RaiseAmount;
    cout << NewSalary;

} //end of main

#include <iostream> using namespace std; Oint main() //Declare variables and constants double CurrentSalary = 0; double Raise = 0; int RaiseAmount = 0; int NewSalary = 0; //Prompt the user for current salary input cout << “Enter current salary: “; cin >> CurrentSalary; //Deciding what percentage raise for new salary based on current salary if (CurrentSalary <= 14999.99) Raise = .05; } else if (15000.00 <= CurrentSalary <= 49999.99), Raise = .07; Raise = .07; else if (50000.00 <= CurrentSalary <= 99999.99), { Raise = .10; else if (CurrentSalary >= 100000.00) i Raise = .15; //Display the Raise amount and the new salary RaiseAmount = CurrentSalary * Raise; cout << RaiseAmount; NewSalary = Current Salary * RaiseAmount ; cout << NewSalary; } //end of main Show transcribed image text #include using namespace std; Oint main() //Declare variables and constants double CurrentSalary = 0; double Raise = 0; int RaiseAmount = 0; int NewSalary = 0; //Prompt the user for current salary input cout CurrentSalary; //Deciding what percentage raise for new salary based on current salary if (CurrentSalary

Expert Answer


Answer to I am having some trouble with getting the RaiseAmount and NewSalary to display, debugging showed no issues with the prog…