質問編集履歴
2
誤字
title
CHANGED
File without changes
|
body
CHANGED
@@ -18,9 +18,9 @@
|
|
18
18
|
#include <fstream>
|
19
19
|
using namespace std;
|
20
20
|
|
21
|
-
class
|
21
|
+
class Library{
|
22
22
|
public:
|
23
|
-
|
23
|
+
Library();
|
24
24
|
string getTitle();
|
25
25
|
string getAuthor();
|
26
26
|
int getYear();
|
@@ -40,7 +40,7 @@
|
|
40
40
|
root = NULL;
|
41
41
|
}
|
42
42
|
bool isEmpty() const { return root==NULL; }
|
43
|
-
void insert(
|
43
|
+
void insert(Library);
|
44
44
|
void print();
|
45
45
|
private:
|
46
46
|
struct node
|
@@ -49,41 +49,41 @@
|
|
49
49
|
node* left;
|
50
50
|
node* right;
|
51
51
|
//treeType data;
|
52
|
-
|
52
|
+
Library data;
|
53
53
|
};
|
54
54
|
node* root;
|
55
55
|
void printPrivate(node* Ptr);
|
56
56
|
};
|
57
57
|
|
58
|
-
|
58
|
+
Library::Library(){
|
59
59
|
|
60
60
|
};
|
61
61
|
|
62
|
-
void
|
62
|
+
void Library::setTitle(string newTitle){
|
63
63
|
title = newTitle;
|
64
64
|
}
|
65
65
|
|
66
|
-
void
|
66
|
+
void Library::setAuthor(string newAuthor){
|
67
67
|
author = newAuthor;
|
68
68
|
}
|
69
69
|
|
70
|
-
void
|
70
|
+
void Library::setYear(int newYear){
|
71
71
|
year = newYear;
|
72
72
|
}
|
73
73
|
|
74
|
-
string
|
74
|
+
string Library::getTitle() {
|
75
75
|
return title;
|
76
76
|
}
|
77
77
|
|
78
|
-
string
|
78
|
+
string Library::getAuthor() {
|
79
79
|
return author;
|
80
80
|
}
|
81
81
|
|
82
|
-
int
|
82
|
+
int Library::getYear(){
|
83
83
|
return year;
|
84
84
|
}
|
85
85
|
|
86
|
-
void BinarySearchTree::insert(
|
86
|
+
void BinarySearchTree::insert(Library l){
|
87
87
|
node* t = new node;
|
88
88
|
node* parent;
|
89
89
|
t->data = l;
|
@@ -148,7 +148,7 @@
|
|
148
148
|
string title;
|
149
149
|
string author;
|
150
150
|
int year;
|
151
|
-
|
151
|
+
Library l;
|
152
152
|
while(file >> title >> author >> year){
|
153
153
|
l.setTitle(title);
|
154
154
|
l.setAuthor(author);
|
1
タグの追加
title
CHANGED
File without changes
|
body
CHANGED
File without changes
|