-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
683 lines (489 loc) · 22.8 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
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
<!DOCTYPE html>
<html lang="en">
<!-- Head tag -->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name='zyiis_check_verify' content='3d03508010c2bdfe27b9d87c7c8f9e9e'>
<meta name="google-site-verification" content="xBT4GhYoi5qRD5tr338pgPM5OWHHIDR6mNg1a3euekI" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="Maizi's Blog - a craftsman of Information Technology">
<meta name="keyword" content="麦子,maizi,IT匠人">
<link rel="shortcut icon" href="/img/favicon.ico">
<title>
麦子的博客 - IT匠人 | Maizi's Blog - a craftsman of Information Technology
</title>
<link rel="canonical" href="https://maizi0122.github.io/">
<!-- Bootstrap Core CSS -->
<link rel="stylesheet" href="/css/bootstrap.min.css">
<!-- Custom CSS -->
<link rel="stylesheet" href="/css/hux-blog.min.css">
<!-- Pygments Highlight CSS -->
<link rel="stylesheet" href="/css/highlight.css">
<!-- My custom style -->
<link rel="stylesheet" href="/css/custom.css">
<!-- Custom Fonts -->
<!-- <link href="http://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css" rel="stylesheet" type="text/css"> -->
<!-- Hux change font-awesome CDN to qiniu -->
<!-- link href="http://cdn.staticfile.org/font-awesome/4.5.0/css/font-awesome.min.css" rel="stylesheet" type="text/css" -->
<link href="https://maizi0122.github.io/css/font-awesome.min.css" rel="stylesheet" type="text/css">
<!-- Hux Delete, sad but pending in China
<link href='http://fonts.googleapis.com/css?family=Lora:400,700,400italic,700italic' rel='stylesheet' type='text/css'>
<link href='http://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800' rel='stylesheet' type='text/
css'>
-->
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
<!-- ga & ba script hoook -->
<script></script>
</head>
<!-- hack iOS CSS :active style -->
<body ontouchstart="">
<!-- Navigation -->
<nav class="navbar navbar-default navbar-custom navbar-fixed-top">
<div class="container-fluid">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header page-scroll">
<button type="button" class="navbar-toggle">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="/">Maizi's Blog</a>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<!-- Known Issue, found by Hux:
<nav>'s height woule be hold on by its content.
so, when navbar scale out, the <nav> will cover tags.
also mask any touch event of tags, unfortunately.
-->
<div id="huxblog_navbar">
<div class="navbar-collapse">
<ul class="nav navbar-nav navbar-right">
<li>
<a href="/">Home</a>
</li>
<li>
<a href="/archives">Archives</a>
</li>
<li>
<a href="/tags">Tags</a>
</li>
<li>
<a href="/about">About</a>
</li>
<!--
<li>
<a href="/archives/">Archives</a>
</li>
<li>
<a href="/about/">About</a>
</li>
<li>
<a href="/tags/">Tag</a>
</li>
-->
</ul>
</div>
</div>
<!-- /.navbar-collapse -->
</div>
<!-- /.container -->
</nav>
<script>
// Drop Bootstarp low-performance Navbar
// Use customize navbar with high-quality material design animation
// in high-perf jank-free CSS3 implementation
var $body = document.body;
var $toggle = document.querySelector('.navbar-toggle');
var $navbar = document.querySelector('#huxblog_navbar');
var $collapse = document.querySelector('.navbar-collapse');
$toggle.addEventListener('click', handleMagic)
function handleMagic(e){
if ($navbar.className.indexOf('in') > 0) {
// CLOSE
$navbar.className = " ";
// wait until animation end.
setTimeout(function(){
// prevent frequently toggle
if($navbar.className.indexOf('in') < 0) {
$collapse.style.height = "0px"
}
},400)
}else{
// OPEN
$collapse.style.height = "auto"
$navbar.className += " in";
}
}
</script>
<!-- Main Content -->
<!-- Page Header -->
<header class="intro-header" style="background-image: url('/img/home-bg.jpg')">
<div class="container">
<div class="row">
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1 ">
<div class="site-heading">
<h1>Maizi's Blog</h1>
<!--<hr class="small">-->
<span class="subheading">To be a craftsman of Information Technology!</span>
</div>
</div>
</div>
</div>
</header>
<!-- Main Content -->
<div class="container">
<div class="row">
<!-- USE SIDEBAR -->
<!-- Post Container -->
<div class="
col-lg-8 col-lg-offset-1
col-md-8 col-md-offset-1
col-sm-12
col-xs-12
post-container
">
<!-- Main Content -->
<div class="post-preview">
<a href="/2016/09/24/ALGORITHM_ABOUT_ARRAY_SORTING-2016-09-24/">
<h2 class="post-title">
A few algorithm about array sorting
</h2>
<h3 class="post-subtitle">
binary-tree sorting | stack sorting
</h3>
<div class="post-content-preview">
排序算法合集之二叉树
二叉树排序算法描述:算法分析: 假若排成升序,用顺序表的数据结构来解决该问题,希尔排序是对直接插入排序的改进算法,该算法的时间复杂度O(n)=nlog₂n(最好时复杂度)①先找到一种算法对整个数组进行’分列’,该博文中使用的是用数组长度加一依次除以 2 3 4…得到的结果最为每’列’中元素相邻位置在原一维数组中的 增量 ②将 ① 中的每一列依次进行直接插入排序,直......
</div>
</a>
<p class="post-meta">
Posted by Maizi on
2016-09-24
</p>
</div>
<hr>
<div class="post-preview">
<a href="/2016/09/16/ALGORITHM_ABOUT_ARRAY_SORTING-2016-09-16/">
<h2 class="post-title">
A few algorithm about array sorting
</h2>
<h3 class="post-subtitle">
shell sorting | fast sorting | merging sorting
</h3>
<div class="post-content-preview">
排序算法合集之希尔
希尔排序算法描述:算法分析: 假若排成升序,用顺序表的数据结构来解决该问题,希尔排序是对直接插入排序的改进算法,该算法的时间复杂度O(n)=nlog₂n(最好时复杂度)①先找到一种算法对整个数组进行’分列’,该博文中使用的是用数组长度加一依次除以 2 3 4…得到的结果最为每’列’中元素相邻位置在原一维数组中的 增量 ②将 ① 中的每一列依次进行直接插入排序,直至最......
</div>
</a>
<p class="post-meta">
Posted by Maizi on
2016-09-16
</p>
</div>
<hr>
<div class="post-preview">
<a href="/2016/09/15/CASTING_EGG_FROM_MICROSOFT-2016-09-15/">
<h2 class="post-title">
A question of interview about egg casting from microsoft
</h2>
<h3 class="post-subtitle">
use algorithm of dynamic planning can easily deal with it
</h3>
<div class="post-content-preview">
来自微软的扔鸡蛋面试题
问题描述如下:
有一栋楼共100层,一个鸡蛋从第N层及以上的楼层落下来会摔破,在第N层以下的楼层落下不会摔破。给你2个鸡蛋,设计方案找出N,并且保证在最坏情况下, 最小化鸡蛋下落的次数。(假设每次摔落时,如果没有摔碎,则不会给鸡蛋带来损耗) 据说下图的力学结构可以保证鸡蛋从......
</div>
</a>
<p class="post-meta">
Posted by Maizi on
2016-09-15
</p>
</div>
<hr>
<div class="post-preview">
<a href="/2016/09/15/BUILD_BINARY_TREE_FROM_ITS_FRONT_SEQUENCE-2016-09-15/">
<h2 class="post-title">
A question about how to build a binary tree from its front traval sequence and middle travel sequence
</h2>
<h3 class="post-subtitle">
know everything about the binary tree can do it easily
</h3>
<div class="post-content-preview">
二叉树相关的算法问题
问题描述如下:
给定一棵二叉树的先序遍历和中序遍历的结果,怎么样获取其后续遍历的结果
算法描述:算法分析:如果某个数组的元素顺序是某棵二叉树的先续遍历的顺序,那么从数组的第一个元素依次向后取元素可以重建这棵二叉树.①从数组的第一个元素依次向后取元素重建这棵二叉树.③后续遍历 ① 中重建的二叉树.
最后贴上代码:12345678910111213141516171819......
</div>
</a>
<p class="post-meta">
Posted by Maizi on
2016-09-15
</p>
</div>
<hr>
<div class="post-preview">
<a href="/2016/09/15/BINARY_TREE_LAYER_TRAVEL-2016-09-15/">
<h2 class="post-title">
A question about how to travel a binary tree in layer sequence
</h2>
<h3 class="post-subtitle">
select a right data structure can solve it easily
</h3>
<div class="post-content-preview">
怎么按层的先后顺序且每层按从左至右的顺序遍历二叉树
问题描述如下:
设计一个算法,按层级的先后顺序来遍历二叉树,且每层元素的遍历顺序也是按从左到右的次序
算法描述:①使用链表来实现队列(用该队列来实现按层访问).②首先将二叉树的根节点放入队列.获取首元素在二叉树中的左右孩子节点,将首元素出队列,然后将左右孩子(存在的话)依次序入队列并维护队列的首位指针的指向.③重复执行 ② 中的操作.直......
</div>
</a>
<p class="post-meta">
Posted by Maizi on
2016-09-15
</p>
</div>
<hr>
<div class="post-preview">
<a href="/2016/09/15/BACK_SEQUENCE_OF_BINARY_TREE_JUDGE-2016-09-15/">
<h2 class="post-title">
A question about how to judge an array is the back sequence of a binary tree
</h2>
<h3 class="post-subtitle">
know everything about the binary tree can do it easily
</h3>
<div class="post-content-preview">
二叉树相关的算法问题
问题描述如下:
设计一个算法,判断是一个数组的元素顺序是某棵二叉树的后续遍历的顺序
算法描述:算法分析:如果这个数组的元素顺序是某棵二叉树的后续遍历的顺序,那么从数组的最后一个元素依次向前取元素可以重建这棵二叉树.①从数组的最后一个元素依次向前取元素重建这棵二叉树.③后续遍历 ① 中重建的二叉树依次序与数组中的元素对比,如果都相同则说明数组的元素顺序是某棵二叉树的后续......
</div>
</a>
<p class="post-meta">
Posted by Maizi on
2016-09-15
</p>
</div>
<hr>
<div class="post-preview">
<a href="/2016/09/15/ALGORITHM_ABOUT_ARRAY_SORTING-2016-09-15/">
<h2 class="post-title">
A few algorithm about array sorting
</h2>
<h3 class="post-subtitle">
bubble sorting | choosing sorting | inserting sorting
</h3>
<div class="post-content-preview">
排序算法合集之起泡
起泡排序算法描述:算法分析: 假若排成升序,用顺序表的数据结构来解决该问题,该算法的时间复杂度O(n)=n²①第一趟结尾位置为数组的最后一个元素,从数组的第一个元素开始依次和其后面的元素比较,若后面的元素较小则交换这两个元素.这样第一趟跑完数组中最大的元素肯定在当前的结尾位置上,后面的每趟都依次将结尾位置向前移动一个位置②重复 ① 中的过程直至该趟的结尾位置和起始位......
</div>
</a>
<p class="post-meta">
Posted by Maizi on
2016-09-15
</p>
</div>
<hr>
<div class="post-preview">
<a href="/2016/09/15/DIDI_BUS-2016-09-15/">
<h2 class="post-title">
A question of interview from DIDI-BUS
</h2>
<h3 class="post-subtitle">
a simple question, but lots of people thought in a complicated way...
</h3>
<div class="post-content-preview">
滴滴打车的一道android面试题
问题描述如下:
有个一个饭店,有n张桌子,每张桌子可以招待不同数量的客人,且不能拼桌,现在来了m批客人,每批客人有两个属性,一个是客人的总数,一个是他们消费(预计)的总额请设计一个算法,计算出店家能够获得的最大利润测试用例:3 5 2 4 21 33 5 3 75 91 103 5代表一共有3个桌子 5批客人2 4 2 代表3张桌子的容量 分别是2 4 ......
</div>
</a>
<p class="post-meta">
Posted by Maizi on
2016-09-15
</p>
</div>
<hr>
<!-- Pager -->
<ul class="pager">
</ul>
<!-- 如果开启评论功能 -->
</div>
<!-- Sidebar Container -->
<div class="
col-lg-3 col-lg-offset-0
col-md-3 col-md-offset-0
col-sm-12
col-xs-12
sidebar-container
">
<!-- Featured Tags -->
<section>
<!-- no hr -->
<h5><a href="/tags/">FEATURED TAGS</a></h5>
<div class="tags">
<a href="/tags/#Algorithm" title="Algorithm" rel="8">Algorithm</a>
<a href="/tags/#Sorting" title="Sorting" rel="3">Sorting</a>
<a href="/tags/#Binary Tree" title="Binary Tree" rel="3">Binary Tree</a>
<a href="/tags/#Queue" title="Queue" rel="1">Queue</a>
<a href="/tags/#LinkList" title="LinkList" rel="1">LinkList</a>
<a href="/tags/#Dynamic planning" title="Dynamic planning" rel="1">Dynamic planning</a>
</div>
</section>
<!-- Short About -->
<section class="visible-md visible-lg">
<hr><h5><a href="/about/">ABOUT ME</a></h5>
<div class="short-about">
<img src="/img/avatar.jpg" />
<p>To be a craftsman of Information Technology</p>
<!-- SNS Link -->
<ul class="list-inline">
<li>
<a target="_blank" href="https://github.com/maizi0122">
<span class="fa-stack fa-lg">
<i class="fa fa-circle fa-stack-2x"></i>
<i class="fa fa-github fa-stack-1x fa-inverse"></i>
</span>
</a>
</li>
</ul>
</div>
</section>
<!-- Friends Blog -->
<hr>
<h5>FRIENDS</h5>
<ul class="list-inline">
<li><a href="http://luics.com/" target="_blank">Alibaba-luics</a></li>
<li><a href="#" target="_blank">Foo</a></li>
<li><a href="#" target="_blank">Bar</a></li>
<li><a href="#" target="_blank">Example Friends</a></li>
<li><a href="#" target="_blank">It helps SEO</a></li>
</ul>
</div>
</div>
</div>
<!-- Footer -->
<!-- Footer -->
<footer>
<div class="container">
<div class="row">
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
<ul class="list-inline text-center">
<li>
<a target="_blank" href="https://github.com/maizi0122">
<span class="fa-stack fa-lg">
<i class="fa fa-circle fa-stack-2x"></i>
<i class="fa fa-github fa-stack-1x fa-inverse"></i>
</span>
</a>
</li>
</ul>
<p class="copyright text-muted">
Copyright © Maizi's Blog 2016
<br/>
Powered by <a href="https://maizi0122.github.io">Maizi</a><br/>
<iframe
style="margin-left: 2px; margin-bottom:-5px;"
frameborder="0" scrolling="0" width="91px" height="20px"
src="https://ghbtns.com/github-btn.html?user=maizi0122&repo=Ripened&type=star&count=true" >
</iframe><br/>
<span id="busuanzi_value_site_pv"></span>th visit
</p>
</div>
</div>
</div>
</footer>
<!-- jQuery -->
<script src="/js/jquery.min.js"></script>
<!-- Bootstrap Core JavaScript -->
<script src="/js/bootstrap.min.js"></script>
<!-- Custom Theme JavaScript -->
<script src="/js/hux-blog.min.js"></script>
<!-- async load function -->
<script>
function async(u, c) {
var d = document, t = 'script',
o = d.createElement(t),
s = d.getElementsByTagName(t)[0];
o.src = u;
if (c) { o.addEventListener('load', function (e) { c(null, e); }, false); }
s.parentNode.insertBefore(o, s);
}
</script>
<!--
Because of the native support for backtick-style fenced code blocks
right within the Markdown is landed in Github Pages,
From V1.6, There is no need for Highlight.js,
so Huxblog drops it officially.
- https://github.com/blog/2100-github-pages-now-faster-and-simpler-with-jekyll-3-0
- https://help.github.com/articles/creating-and-highlighting-code-blocks/
-->
<!--
<script>
async("http://cdn.bootcss.com/highlight.js/8.6/highlight.min.js", function(){
hljs.initHighlightingOnLoad();
})
</script>
<link href="http://cdn.bootcss.com/highlight.js/8.6/styles/github.min.css" rel="stylesheet">
-->
<!-- jquery.tagcloud.js -->
<script>
// only load tagcloud.js in tag.html
if($('#tag_cloud').length !== 0){
async("https://maizi0122.github.io/js/jquery.tagcloud.js",function(){
$.fn.tagcloud.defaults = {
//size: {start: 1, end: 1, unit: 'em'},
color: {start: '#bbbbee', end: '#0085a1'},
};
$('#tag_cloud a').tagcloud();
})
}
</script>
<!--fastClick.js -->
<script>
async("https://maizi0122.github.io/js/fastclick.min.js", function(){
var $nav = document.querySelector("nav");
if($nav) FastClick.attach($nav);
})
</script>
<!-- Google Analytics -->
<script>
// dynamic User by Hux
var _gaId = 'UA-84264150-1';
var _gaDomain = 'github.io';
// Originial
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', _gaId, _gaDomain);
ga('send', 'pageview');
</script>
<!-- Baidu Tongji -->
<script>
// dynamic User by Hux
var _baId = '8b35f5fc93783caa6533273688f619f3';
// Originial
var _hmt = _hmt || [];
(function() {
var hm = document.createElement("script");
hm.src = "//hm.baidu.com/hm.js?" + _baId;
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
})();
</script>
<!-- Side Catalog -->
<!-- visit counter -->
<script async src="//dn-lbstatics.qbox.me/busuanzi/2.3/busuanzi.pure.mini.js"></script>
<!-- Image to hack wechat -->
<img src="/img/icon_wechat.png" width="0" height="0" />
<!-- Migrate from head to bottom, no longer block render and still work -->
</body>
</html>