34 lines
649 B
C++
34 lines
649 B
C++
//************************ cirSLList.h **************************
|
|
// singly-linked list class to store integers
|
|
|
|
#ifndef INT_LINKED_LIST
|
|
#define INT_LINKED_LIST
|
|
|
|
#include "circle.h"
|
|
|
|
class cirSLLNode {
|
|
public:
|
|
Circle info;
|
|
cirSLLNode(double el, cirSLLNode *ptr = 0) {
|
|
info.setRadius(el); next = ptr;
|
|
}
|
|
cirSLLNode *next;
|
|
};
|
|
|
|
class cirSLList {
|
|
public:
|
|
cirSLList() {
|
|
head = tail = NULL;
|
|
}
|
|
~cirSLList();
|
|
int isEmpty() {
|
|
return head == 0;
|
|
}
|
|
void addToTail(double);
|
|
bool isInList(Circle) const;
|
|
void displayAllElements();
|
|
private:
|
|
cirSLLNode *head, *tail;
|
|
};
|
|
|
|
#endif
|