-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
298 lines (167 loc) · 8.31 KB
/
index.html
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>小白程序员的note</title>
<meta name="author" content="看萌baby">
<meta name="description" content="爱音乐,爱生活。">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta property="og:site_name" content="小白程序员的note"/>
<meta property="og:image" content="undefined"/>
<link href="/favicon.png" rel="icon">
<link rel="alternate" href="/atom.xml" title="小白程序员的note" type="application/atom+xml">
<link rel="stylesheet" href="/css/style.css" media="screen" type="text/css">
<!--[if lt IE 9]><script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
</head>
<body>
<header id="header" class="inner"><div class="alignleft">
<h1><a href="/">小白程序员的note</a></h1>
<h2><a href="/"></a></h2>
</div>
<nav id="main-nav" class="alignright">
<ul>
<li><a href="/">Home</a></li>
<li><a href="/archives">Archives</a></li>
</ul>
<div class="clearfix"></div>
</nav>
<div class="clearfix"></div>
</header>
<div id="content" class="inner">
<div id="main-col" class="alignleft"><div id="wrapper">
<article class="post">
<div class="post-content">
<header>
<div class="icon"></div>
<time datetime="2016-03-15T06:46:47.000Z"><a href="/2016/03/15/看图写树/">2016-03-15</a></time>
<h1 class="title"><a href="/2016/03/15/看图写树/">看图写树</a></h1>
</header>
<div class="entry">
<h3 id="解析"><a href="#解析" class="headerlink" title="解析"></a>解析</h3><p>一般感觉和树有关的题目递归较好解决。此题中收获以下几个知识点:<br>1.fgets这类函数会把\n读到字符串里面,而scanf,cin这类的输入不会将\n读入;<br>2.处理的输入多的时候没必要一次性将所有的数据读入,读入一组处理一组即可。</p>
</div>
<footer>
<div class="alignleft">
<a href="/2016/03/15/看图写树/#more" class="more-link">Read More</a>
</div>
<div class="clearfix"></div>
</footer>
</div>
</article>
<article class="post">
<div class="post-content">
<header>
<div class="icon"></div>
<time datetime="2016-03-14T13:00:00.000Z"><a href="/2016/03/14/智能指针/">2016-03-14</a></time>
<h1 class="title"><a href="/2016/03/14/智能指针/">智能指针</a></h1>
</header>
<div class="entry">
<p>当类中有指针成员时,一般有两种方式来管理指针成员:一是采用值型的方式管理,每个类对象都保留一份指针指向的对象的拷贝;另一种更优雅的方式是使用智能指针,从而实现指针指向的对象的共享。智能指针(smart pointer)的一种通用实现技术是使用引用计数(reference count)。智能指针类将一个计数器与类指向的对象相关联,引用计数跟踪该类有多少个对象的指针指向同一对象。智能指针都位于头文件memory中,智能指针是非线程安全的。</p>
</div>
<footer>
<div class="alignleft">
<a href="/2016/03/14/智能指针/#more" class="more-link">Read More</a>
</div>
<div class="clearfix"></div>
</footer>
</div>
</article>
<article class="post">
<div class="post-content">
<header>
<div class="icon"></div>
<time datetime="2016-03-14T03:11:00.000Z"><a href="/2016/03/14/c++_boost内存管理/">2016-03-14</a></time>
<h1 class="title"><a href="/2016/03/14/c++_boost内存管理/">boost内存管理</a></h1>
</header>
<div class="entry">
<p>Boost库提供了6种智能指针,位于boost命名空间。分别为shared_ptr、weak_ptr、scoped_ptr、scoped_array、shared_array、intrusive_ptr。<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">#include <boost/smart_ptr.hpp></span><br><span class="line">using namespace std;</span><br></pre></td></tr></table></figure></p>
</div>
<footer>
<div class="alignleft">
<a href="/2016/03/14/c++_boost内存管理/#more" class="more-link">Read More</a>
</div>
<div class="clearfix"></div>
</footer>
</div>
</article>
<article class="post">
<div class="post-content">
<header>
<div class="icon"></div>
<time datetime="2016-03-13T13:12:19.000Z"><a href="/2016/03/13/c++_重载new与delete/">2016-03-13</a></time>
<h1 class="title"><a href="/2016/03/13/c++_重载new与delete/">重载new与delete</a></h1>
</header>
<div class="entry">
<ul>
<li>new和delete的机制</li>
</ul>
<p>new分3步,首先new表达式用一个名为operarot new或者operator new[]的标准库函数来分配一块足够大的原始内存;然后编译器运行相应的构造函数来构造;最后构造完成之后返回一个指向该对象的指针。delete分2步,首先对指针指向的内存执行析构操作,然后调用operator delete或者operator delete[]释放相应空间。</p>
</div>
<footer>
<div class="alignleft">
<a href="/2016/03/13/c++_重载new与delete/#more" class="more-link">Read More</a>
</div>
<div class="clearfix"></div>
</footer>
</div>
</article>
<article class="post">
<div class="post-content">
<header>
<div class="icon"></div>
<time datetime="2016-03-13T08:36:59.000Z"><a href="/2016/03/13/allocator类/">2016-03-13</a></time>
<h1 class="title"><a href="/2016/03/13/allocator类/">allocator类</a></h1>
</header>
<div class="entry">
<ul>
<li>new和delete的局限性<br>new在使用时将分配内存与初始化结合在了一起,而delete将析构与释放内存结合在了一起。对于单个对象的分配与析构,这毫无问题。但对于大量的元素,也许我们并不知道需要多少个对象,仅仅只是先分配一块内存,真正需要时再进行构造。
</div>
<footer>
<div class="alignleft">
<a href="/2016/03/13/allocator类/#more" class="more-link">Read More</a>
</div>
<div class="clearfix"></div>
</footer>
</div>
</article>
<nav id="pagination">
<a href="/page/2/" class="alignright next">下一页</a>
<div class="clearfix"></div>
</nav></div></div>
<aside id="sidebar" class="alignright">
<div class="search">
<form action="//google.com/search" method="get" accept-charset="utf-8">
<input type="search" name="q" results="0" placeholder="搜索">
<input type="hidden" name="q" value="site:lee3164.com">
</form>
</div>
<div class="widget tag">
<h3 class="title">标签</h3>
<ul class="entry">
<li><a href="/tags/boost/">boost</a><small>1</small></li>
<li><a href="/tags/c/">c</a><small>3</small></li>
<li><a href="/tags/c艹/">c艹</a><small>21</small></li>
<li><a href="/tags/操作系统/">操作系统</a><small>1</small></li>
<li><a href="/tags/数据结构与算法/">数据结构与算法</a><small>2</small></li>
<li><a href="/tags/算法/">算法</a><small>5</small></li>
<li><a href="/tags/面试题/">面试题</a><small>3</small></li>
</ul>
</div>
</aside>
<div class="clearfix"></div>
</div>
<footer id="footer" class="inner"><div class="alignleft">
© 2016 看萌baby
</div>
<div class="clearfix"></div></footer>
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>
<script src="/js/jquery.imagesloaded.min.js"></script>
<script src="/js/gallery.js"></script>
<link rel="stylesheet" href="/fancybox/jquery.fancybox.css" media="screen" type="text/css">
<script src="/fancybox/jquery.fancybox.pack.js"></script>
<script type="text/javascript">
(function($){
$('.fancybox').fancybox();
})(jQuery);
</script>
</body>
</html>