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).
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here