Given the following definition for a LinkedList: // LinkedList.h class LinkedList { public: LinkedList(); // TODO: Implement me void printEveryOther() const; private: struct Node { int data; Node*...


Given the following definition for a LinkedList:


// LinkedList.h


class LinkedList {


public: LinkedList();


// TODO: Implement me void printEveryOther() const;


private:


struct Node {


int data;


Node* next; };


Node * head; };


// LinkedList.cpp


#include "LinkedList.h"


LinkedList::LinkedList() {


head = nullptr; }


Implement the function printEveryOther, which prints every other data value (i.e. those at the odd indices assuming 0-based indexing).



Jun 04, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions ยป

Submit New Assignment

Copy and Paste Your Assignment Here