Answered step by step
Verified Expert Solution
Question
1 Approved Answer
#include linked_list.h namespace lab { class queue { private : linked_list storage_structure; public : queue(); queue(std::string &data); queue( const queue &original); virtual ~queue(); queue &
#include "linked_list.h" namespace lab { class queue { private: linked_list storage_structure; public: queue(); queue(std::string &data); queue(const queue &original); virtual ~queue(); queue &operator=(const queue &RHS); bool isEmpty() const; unsigned queueSize() const; std::string top() const; void enqueue(const std::string &data); void dequeue(); friend std::ostream& operator<<(std::ostream& stream, queue& RHS); friend std::istream& operator>>(std::istream& stream, queue& RHS); }; } #endif
//header file for linked list #include "node.h" #includenamespace lab { class linked_list { node *tail; node * head; public: linked_list(); explicit linked_list(std::string &data); linked_list(const linked_list &original); virtual ~linked_list(); linked_list &operator=(const linked_list &RHS); friend std::ostream& operator<<(std::ostream& stream, linked_list& RHS); friend std::istream& operator>>(std::istream& stream, linked_list& RHS); bool isEmpty() const; unsigned listSize() const; std::string get_value_at(unsigned location); void insert(const std::string input, unsigned location = 0 ); void append(const std::string input); void remove(unsigned location = 0); void sort(); }; } #endif
#include "queue.h" namespace lab{ queue::queue() { } queue::queue(std::string &data) { } queue::queue(const queue &original) { } queue::~queue() { } queue &queue::operator=(const queue &RHS) { //return <#initializer#>; } bool queue::isEmpty() const { return false; } unsigned queue::queueSize() const { return 0; } std::string queue::top() const { //return std::__cxx11::string(); } void queue::enqueue(const std::string &data) { } void queue::dequeue() { } std::ostream& operator<<(std::ostream &stream, queue &RHS) { return stream; } std::istream& operator>>(std::istream &stream, queue &RHS) { return stream; } }
Note: just do queue.cpp using C++
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access with AI-Powered Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started