Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ void CLL::push(char data) { // You write - if the size is 0, add a first node in the linked list // by calling

C++

void CLL::push(char data) { // You write - if the size is 0, add a first node in the linked list // by calling addFirst. Otherwise add a new node to the end of the linked list. Note that this // linked list is circular, so you must make the last node's next pointer point to the first node. } void CLL::addFirst(char data) { // you write - add the very first node to the linked list } void CLL::addAtFront(char data) { // you write - if the size of the linked list is 0, add a first node by calling addFirst. //Otherwise add a new node to the beginning of the list //Since this linked list is circular, you must make the last node now point to this new node //you just added to the front of the linked list }

void CLL::printList(){ // print out the data in each node in the linked list, starting at the first node. } You will also be modifying the file DuckDuckGoose.cpp to fill in the methods as defined below:

void DuckDuckGoose::MakeListEnd() { // create a linked list by pushing every character in arr1 to the end of linked list clist (the field in // DuckDuckGoose } void DuckDuckGoose::MakeListBoth() { // create a linked list by alternately pushing and adding at front every character in arr2 onto the linked list // clist (so if i%0 == 0, push arr2[i], and otherwise addAtFront arr2[i]) }

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions