Clean up old and new files
This commit is contained in:
@@ -185,12 +185,13 @@ bool CircleSingleList::isEmpty() const
|
||||
*
|
||||
* @return int The value held at the Node at the head of our linked list
|
||||
*/
|
||||
void CircleSingleList::peek() const
|
||||
int CircleSingleList::peek() const
|
||||
{
|
||||
// If there is only one data member, a circular list node will point to itself
|
||||
if (!isEmpty())
|
||||
std::cout << "[" << tail->next->data << "] is at the top of our list\n";
|
||||
else std::cout << "Nothing to peek, our list is empty...\n";
|
||||
return tail->next->data;
|
||||
}
|
||||
|
||||
/** print
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
|
||||
#include <iostream>
|
||||
|
||||
class CircleSingleList{
|
||||
class CircleSingleList {
|
||||
public:
|
||||
CircleSingleList() : tail(NULL) {};
|
||||
CircleSingleList(const CircleSingleList& rhs);
|
||||
@@ -25,7 +25,7 @@ class CircleSingleList{
|
||||
bool replace(int val, int key);
|
||||
void makeEmpty();
|
||||
bool isEmpty() const;
|
||||
void peek() const;
|
||||
int peek() const;
|
||||
void print() const;
|
||||
bool find(int val) const;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user