-
Notifications
You must be signed in to change notification settings - Fork 0
/
IntNode.h
32 lines (26 loc) · 809 Bytes
/
IntNode.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
//
// Created by hloi on 2/23/2022.
//
#ifndef CSC10901SP22CH08LINKEDLIST_INTNODE_H
#define CSC10901SP22CH08LINKEDLIST_INTNODE_H
#include <iostream>
using std::ostream;
class IntNode {
public:
IntNode(int dataInit = 0, IntNode* nextLoc = nullptr);
IntNode* GetNext();
int GetDataVal() const;
void SetNextNodePtr(IntNode *nextNodePtr);
void insertAfter(IntNode* node);
void PrintNodeData();
~IntNode();
bool operator==(const IntNode* other);
void setDataVal(int dataVal);
friend ostream& operator<<(ostream& out, const IntNode& node);
// friend ostream& operator>>(ostream& in, const IntNode& node);
// override the extaction operator for the node class.
private:
int dataVal;
IntNode* nextNodePtr;
};
#endif //CSC10901SP22CH08LINKEDLIST_INTNODE_H