-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNode.cpp
More file actions
executable file
·42 lines (33 loc) · 935 Bytes
/
Copy pathNode.cpp
File metadata and controls
executable file
·42 lines (33 loc) · 935 Bytes
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
33
34
35
36
37
38
39
40
41
42
// Node.cpp
// Created by Frank M. Carrano and Timothy M. Henry.
// Updated by Duc Ta
// Copyright (c) 2017 Pearson Education, Hoboken, New Jersey.
#include "Node.h"
//
//
// PLEASE DO NOT CHANGE THIS FILE
//
//
template<typename ItemType>
Node<ItemType>::Node() : next(nullptr) {}
template<typename ItemType>
Node<ItemType>::Node(const ItemType& anItem) : item(anItem), next(nullptr) {}
template<typename ItemType>
Node<ItemType>::Node(const ItemType& anItem, Node<ItemType>* nextNodePtr) :
item(anItem), next(nextNodePtr) {}
template<typename ItemType>
void Node<ItemType>::setItem(const ItemType& anItem) {
item = anItem;
}
template<typename ItemType>
void Node<ItemType>::setNext(Node<ItemType>* nextNodePtr) {
next = nextNodePtr;
}
template<typename ItemType>
ItemType Node<ItemType>::getItem() const {
return item;
}
template<typename ItemType>
Node<ItemType>* Node<ItemType>::getNext() const {
return next;
}