Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

hello there, need help on this. Im coding it in C++, nothing else! Need a Queue

ID: 3817790 • Letter: H

Question

hello there, need help on this. Im coding it in C++, nothing else!

Need a Queue Class using doubly-linked structure, which can also do these:

   Enque

   Dequeue

   isEmpty

   makeEmpty()

   Peek

   Print

reversePrint

My program will have an Tumblr class, which will #include the Queue in my Tumblr class.

My data members can be

“Que<DataType>FollowerList” = which is the Followerlist in the que form.
“Int numofFollowers” = keeps track of the # of followers

“DataType user” = who will be followed

The tumblr class will have the following:

   addFollower()

   removeFollower()

   printFollowerF (prints them from the front to the end)

   printFollowerR (prints them from the end to the front)

   firstFollower()

   resetFollowers()

   checklist()

My main program should #include the Tumblr class, which I have a text document of friends with their address next to them, they will be my followers.

   addFollower() will add my friends form the text.doc to the FollowerList

   And it should do everything from the tumblr class, which si add, remove, print front, print end, first, reset, etc.


thanks for any helps.

Explanation / Answer

#include <iostream>
#include <list>

int main ()
{
std::list<int> lists;
lists.push_back (100);
lists.push_back (200);
lists.push_back (300);

std::cout << "Popping out the elements in lists:";
while (!lists.empty())
{
std::cout << ' ' << lists.front();
lists.pop_front();
}

std::cout << " Final size of lists is " << lists.size() << ' ';

return 0;
}
Edit & Run