______ is a testing technique in which one attempts to run through all possible combinations of branch paths through the code.
Testing a program based on varying input values without knowing what the code looks like is called _____.
With _____ testing, you make sure that every instruction in the code is executed at least once.
All instance methods in C++ have a hidden first argument named ________.
In a linked list, the last node's next point always has the value ______.
In the LinkedList class, the hidden argument's type is ______.
Rewrite the following line for a linked list rather than an array.
Make sure you use getters and setters. Assume the same Node class as we saw
in lecture. I have started it for you.
for(int i=0;i10) for(Node *tmp; ; )
--------------------
Node::Node()
{
data = 0;
next = NULL;
}
Node::Node(int d)
{
data = d;
next = NULL;
}
----------------
#ifndef LINKEDLIST_H
#define LINKEDLIST_H
#include
#include
using namespace std;
class Node {
private:
int data;
Node *next;
public:
Node(); // default constructor
Node(int d);
// setters and getters
void setData(int d) { data = d; }
void setNext(Node *n) { next = n; }
int getData() const { return data;}
Node *getNext() const { return next;}
}; // end of Node
class LinkedList {
private:
Node *head;
public:
LinkedList();
void addHead(int);
void printList(FILE *) const;
};
#endif