-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLinkedList.h
More file actions
52 lines (49 loc) · 835 Bytes
/
LinkedList.h
File metadata and controls
52 lines (49 loc) · 835 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
43
44
45
46
47
48
49
50
51
52
#pragma once
#define TO_THE_LAST -1
#define TO_THE_TOP 0
#define TO_THE_FIRST 1
#define SET_PREVIOUS true
#define SET_NEXT false
struct Chars
{
public:
wchar_t item;
Chars * previous;
Chars * next;
Chars(wchar_t c, Chars * previous, Chars * next)
{
item = c;
this->next = next;
this->previous = previous;
}
void Set_Pos(Chars * previous, Chars * next)
{
this->previous = previous;
this->next = next;
}
void Set_Pos(Chars * temp, bool x)
{
if (x)
this->previous = temp;
else
this->next = temp;
}
};
class LinkedList
{
private:
Chars * first;
Chars * last;
Chars * present;
LinkedList(const LinkedList &);
public:
LinkedList();
LinkedList(wchar_t x);
~LinkedList();
bool Add(wchar_t x);
bool Delete();
bool Search(wchar_t x);
bool Search(int x);
bool Read(wchar_t ** x);
wchar_t Read();
};