Question Description
Hello, I attached all files below.
Please write strictly under the following requirements.
Thank you
Fill in LLQueue.hpp
○ Your implementation must be based on a LinkedList.
○ Your implementation must fit the interface given
○ Your implementation must be templated
■ An implementation of LLQueue that does not properly template may
cause you to get a zero on this assignment. Do not assume that
working for ints is sufficient, despite those being the only cases in
the provided test cases. Test with non-numeric data types as well!
■ No, really; pay attention to that warning. Students may end up with
zeroes for this project if their code is not properly templated, regardless of
other considerations.
○ When attempting to access the front of an empty queue, or to dequeue from an
empty queue, you must throw a QueueEmptyException as appropriate.
○ Do not throw an exception upon addition of an element: there is no capacity
(beyond what memory allows).
○ Please note: the template will not build successfully until you have at least
stubbed code for the Queue functions.
○ You also need to write a copy constructor and an assignment operator. These
should be “deep copies” — you should end up with a second queue that has the
same contents as the first, not merely two objects each with a pointer to the front
of the same linked list.
● Write function void countPaths(const std::vector<
std::vector<unsigned> > & friends, unsigned start,
std::vector<unsigned> & pathLengths, std::vector<unsigned> &
numShortestPaths) in proj2.cpp.
○ This problem deals with having a group of people, numbered from 0 to
friends.size() – 1. The vector friends[ i ] is a list of who person i is friends with.
You may assume for this project that friendship is symmetric (if A is friends with
B, then B is also friends with A).
○ The last two parameters are provided as initially empty, with size equal to
friends.size().
○ Your assignment is to fill these vectors such that:
■ For all i , pathLengths[ i ] is the length of the shortest path from start to i in
the graph described by friends.
■ For all i , numShortestPaths[ i ] is the number of distinct paths from start to
i in the graph. Figuring out how to compute this is a fundamental part of
this assignment.
● Your implementation does not have to be the most efficient thing ever, but it cannot be
“too slow.” In general, any test case that takes over a minute on the grader’s computer
may be deemed a wrong answer, even if it will later return a correct one.
You are prohibited from using any standard library container classes when implementing your
LLQueue . Other than the std::vector parameters, you may not use any C++ library
container classes when implementing proj2.cpp. If you need a queue, for example1, use your
LLQueue implementation.