mirror of
https://github.com/zach-sb/SENG1120-Assignment-1.git
synced 2025-11-09 02:27:38 +11:00
64 lines
1.1 KiB
C++
64 lines
1.1 KiB
C++
/*
|
|
Name: LinkedList.h
|
|
Author: Zach Seibel-Barnes
|
|
Student Number: c3262201
|
|
Last Modified: 16/09/2020
|
|
|
|
Description:
|
|
*/
|
|
|
|
#ifndef GUARD_LINKEDLIST
|
|
#define GUARD_LINKEDLIST
|
|
#include <string>
|
|
#include <iostream>
|
|
#include "Node.h"
|
|
|
|
class LinkedList
|
|
{
|
|
public:
|
|
|
|
typedef Node::valueType valueType; //Continue with our typedef from Node.h
|
|
|
|
LinkedList(); //Constructor
|
|
~LinkedList(); //deconstructor
|
|
|
|
//Accessors
|
|
void addToHead(const valueType& data);
|
|
void addToCurrent(const valueType& data);
|
|
void addToTail(const valueType& data);
|
|
|
|
|
|
//Data Mutators
|
|
void add(const valueType addString);
|
|
|
|
void remove(const valueType removeString);
|
|
|
|
void sort();
|
|
|
|
//Queries
|
|
int count(const valueType countString);
|
|
|
|
int currentSelect(char option='h');
|
|
|
|
valueType buildString() const;
|
|
|
|
valueType getNodeData(int wordNum) const;
|
|
int getWordCount() const;
|
|
|
|
|
|
void operator += (LinkedList& list);
|
|
|
|
private:
|
|
Node* head;
|
|
Node* tail;
|
|
Node* current;
|
|
|
|
};
|
|
|
|
//Operator Overloading
|
|
|
|
std::ostream& operator << (std::ostream& out, const LinkedList& list);
|
|
|
|
|
|
|
|
#endif |