-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
737 lines (348 loc) · 23.4 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
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
<!DOCTYPE HTML>
<html lang="en" >
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title>数据结构与算法(Python) | 数据结构与算法(Python)</title>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<meta name="description" content="我们举一个可能不太恰当的例子:">
<meta name="generator" content="GitBook 2.6.7">
<meta name="HandheldFriendly" content="true"/>
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<link rel="apple-touch-icon-precomposed" sizes="152x152" href="gitbook/images/apple-touch-icon-precomposed-152.png">
<link rel="shortcut icon" href="gitbook/images/favicon.ico" type="image/x-icon">
<link rel="stylesheet" href="gitbook/style.css">
<link rel="stylesheet" href="gitbook/plugins/gitbook-plugin-highlight/website.css">
<link rel="stylesheet" href="gitbook/plugins/gitbook-plugin-search/search.css">
<link rel="stylesheet" href="gitbook/plugins/gitbook-plugin-fontsettings/website.css">
<link rel="next" href="./chapter1/index.html" />
</head>
<body>
<div class="book"
data-level="0"
data-chapter-title="数据结构与算法(Python)"
data-filepath="README.md"
data-basepath="."
data-revision="Fri Mar 31 2017 18:24:30 GMT+0800 (CST)"
data-innerlanguage="">
<div class="book-summary">
<nav role="navigation">
<ul class="summary">
<li class="chapter active" data-level="0" data-path="index.html">
<a href="./index.html">
<i class="fa fa-check"></i>
数据结构与算法(Python)
</a>
</li>
<li class="chapter " data-level="1" data-path="chapter1/index.html">
<a href="./chapter1/index.html">
<i class="fa fa-check"></i>
<b>1.</b>
引入概念
</a>
<ul class="articles">
<li class="chapter " data-level="1.1" data-path="chapter1/section1.html">
<a href="./chapter1/section1.html">
<i class="fa fa-check"></i>
<b>1.1.</b>
第一次尝试
</a>
</li>
<li class="chapter " data-level="1.2" data-path="chapter1/section2.html">
<a href="./chapter1/section2.html">
<i class="fa fa-check"></i>
<b>1.2.</b>
算法的提出
</a>
</li>
<li class="chapter " data-level="1.3" data-path="chapter1/section3.html">
<a href="./chapter1/section3.html">
<i class="fa fa-check"></i>
<b>1.3.</b>
第二次尝试
</a>
</li>
<li class="chapter " data-level="1.4" data-path="chapter1/section4.html">
<a href="./chapter1/section4.html">
<i class="fa fa-check"></i>
<b>1.4.</b>
算法效率衡量
</a>
</li>
<li class="chapter " data-level="1.5" data-path="chapter1/section5.html">
<a href="./chapter1/section5.html">
<i class="fa fa-check"></i>
<b>1.5.</b>
算法分析
</a>
</li>
<li class="chapter " data-level="1.6" data-path="chapter1/section6.html">
<a href="./chapter1/section6.html">
<i class="fa fa-check"></i>
<b>1.6.</b>
常见时间复杂度
</a>
</li>
<li class="chapter " data-level="1.7" data-path="chapter1/section7.html">
<a href="./chapter1/section7.html">
<i class="fa fa-check"></i>
<b>1.7.</b>
Python内置类型性能分析
</a>
</li>
<li class="chapter " data-level="1.8" data-path="chapter1/section8.html">
<a href="./chapter1/section8.html">
<i class="fa fa-check"></i>
<b>1.8.</b>
数据结构
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="2" data-path="chapter2/index.html">
<a href="./chapter2/index.html">
<i class="fa fa-check"></i>
<b>2.</b>
顺序表
</a>
<ul class="articles">
<li class="chapter " data-level="2.1" data-path="chapter2/section1.html">
<a href="./chapter2/section1.html">
<i class="fa fa-check"></i>
<b>2.1.</b>
顺序表的形式
</a>
</li>
<li class="chapter " data-level="2.2" data-path="chapter2/section2.html">
<a href="./chapter2/section2.html">
<i class="fa fa-check"></i>
<b>2.2.</b>
顺序表的结构与实现
</a>
</li>
<li class="chapter " data-level="2.3" data-path="chapter2/section3.html">
<a href="./chapter2/section3.html">
<i class="fa fa-check"></i>
<b>2.3.</b>
顺序表的操作
</a>
</li>
<li class="chapter " data-level="2.4" data-path="chapter2/section4.html">
<a href="./chapter2/section4.html">
<i class="fa fa-check"></i>
<b>2.4.</b>
Python中的顺序表
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="3" data-path="chapter3/index.html">
<a href="./chapter3/index.html">
<i class="fa fa-check"></i>
<b>3.</b>
链表
</a>
<ul class="articles">
<li class="chapter " data-level="3.1" data-path="chapter3/section1.html">
<a href="./chapter3/section1.html">
<i class="fa fa-check"></i>
<b>3.1.</b>
单向链表
</a>
</li>
<li class="chapter " data-level="3.2" data-path="chapter3/section2.html">
<a href="./chapter3/section2.html">
<i class="fa fa-check"></i>
<b>3.2.</b>
单项循环链表
</a>
</li>
<li class="chapter " data-level="3.3" data-path="chapter3/section3.html">
<a href="./chapter3/section3.html">
<i class="fa fa-check"></i>
<b>3.3.</b>
双向链表
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="4" data-path="chapter4/index.html">
<a href="./chapter4/index.html">
<i class="fa fa-check"></i>
<b>4.</b>
栈
</a>
<ul class="articles">
<li class="chapter " data-level="4.1" data-path="chapter4/section1.html">
<a href="./chapter4/section1.html">
<i class="fa fa-check"></i>
<b>4.1.</b>
栈结构实现
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="5" data-path="chapter5/index.html">
<a href="./chapter5/index.html">
<i class="fa fa-check"></i>
<b>5.</b>
队列
</a>
<ul class="articles">
<li class="chapter " data-level="5.1" data-path="chapter5/section1.html">
<a href="./chapter5/section1.html">
<i class="fa fa-check"></i>
<b>5.1.</b>
队列的实现
</a>
</li>
<li class="chapter " data-level="5.2" data-path="chapter5/section3.html">
<a href="./chapter5/section3.html">
<i class="fa fa-check"></i>
<b>5.2.</b>
双端队列
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="6" data-path="chapter6/index.html">
<a href="./chapter6/index.html">
<i class="fa fa-check"></i>
<b>6.</b>
排序与搜索
</a>
<ul class="articles">
<li class="chapter " data-level="6.1" data-path="chapter6/section1.html">
<a href="./chapter6/section1.html">
<i class="fa fa-check"></i>
<b>6.1.</b>
冒泡排序
</a>
</li>
<li class="chapter " data-level="6.2" data-path="chapter6/section2.html">
<a href="./chapter6/section2.html">
<i class="fa fa-check"></i>
<b>6.2.</b>
选择排序
</a>
</li>
<li class="chapter " data-level="6.3" data-path="chapter6/section3.html">
<a href="./chapter6/section3.html">
<i class="fa fa-check"></i>
<b>6.3.</b>
插入排序
</a>
</li>
<li class="chapter " data-level="6.4" data-path="chapter6/section4.html">
<a href="./chapter6/section4.html">
<i class="fa fa-check"></i>
<b>6.4.</b>
快速排序
</a>
</li>
<li class="chapter " data-level="6.5" data-path="chapter6/section5.html">
<a href="./chapter6/section5.html">
<i class="fa fa-check"></i>
<b>6.5.</b>
希尔排序
</a>
</li>
<li class="chapter " data-level="6.6" data-path="chapter6/section6.html">
<a href="./chapter6/section6.html">
<i class="fa fa-check"></i>
<b>6.6.</b>
归并排序
</a>
</li>
<li class="chapter " data-level="6.7" data-path="chapter6/section7.html">
<a href="./chapter6/section7.html">
<i class="fa fa-check"></i>
<b>6.7.</b>
常见排序算法效率比较
</a>
</li>
<li class="chapter " data-level="6.8" data-path="chapter6/section8.html">
<a href="./chapter6/section8.html">
<i class="fa fa-check"></i>
<b>6.8.</b>
搜索
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="7" data-path="chapter7/index.html">
<a href="./chapter7/index.html">
<i class="fa fa-check"></i>
<b>7.</b>
树与树算法
</a>
<ul class="articles">
<li class="chapter " data-level="7.1" data-path="chapter7/section1.html">
<a href="./chapter7/section1.html">
<i class="fa fa-check"></i>
<b>7.1.</b>
二叉树
</a>
</li>
<li class="chapter " data-level="7.2" data-path="chapter7/section2.html">
<a href="./chapter7/section2.html">
<i class="fa fa-check"></i>
<b>7.2.</b>
二叉树的遍历
</a>
</li>
</ul>
</li>
<li class="divider"></li>
<li>
<a href="https://www.gitbook.com" target="blank" class="gitbook-link">
Published with GitBook
</a>
</li>
</ul>
</nav>
</div>
<div class="book-body">
<div class="body-inner">
<div class="book-header" role="navigation">
<!-- Actions Left -->
<!-- Title -->
<h1>
<i class="fa fa-circle-o-notch fa-spin"></i>
<a href="./" >数据结构与算法(Python)</a>
</h1>
</div>
<div class="page-wrapper" tabindex="-1" role="main">
<div class="page-inner">
<section class="normal" id="section-">
<h1 id="数据结构与算法(python)">数据结构与算法(Python)</h1>
<h2 id="why?">Why?</h2>
<p>我们举一个可能不太恰当的例子:</p>
<p>如果将最终写好运行的程序比作战场,我们码农便是指挥作战的将军,而我们所写的代码便是士兵和武器。</p>
<p><strong>那么数据结构和算法是什么?答曰:兵法!</strong></p>
<p>我们可以不看兵法在战场上肉搏,如此,可能会胜利,可能会失败。即使胜利,可能也会付出巨大的代价。我们写程序亦然:没有看过数据结构和算法,有时面对问题可能会没有任何思路,不知如何下手去解决;大部分时间可能解决了问题,可是对程序运行的效率和开销没有意识,性能低下;有时会借助别人开发的利器暂时解决了问题,可是遇到性能瓶颈的时候,又不知该如何进行针对性的优化。</p>
<p>如果我们常看兵法,便可做到胸有成竹,有时会事半功倍!同样,如果我们常看数据结构与算法,我们写程序时也能游刃有余、明察秋毫,遇到问题时亦能入木三分、迎刃而解。</p>
<p><strong>故,数据结构和算法是一名程序开发人员的必备基本功,不是一朝一夕就能练成绝世高手的。冰冻三尺非一日之寒,需要我们平时不断的主动去学习积累。</strong></p>
<p><strong>通过三天的学习,我们希望让大家能理解其概念,掌握常用的数据结构和算法。</strong></p>
</section>
</div>
</div>
</div>
<a href="./chapter1/index.html" class="navigation navigation-next navigation-unique" aria-label="Next page: 引入概念"><i class="fa fa-angle-right"></i></a>
</div>
</div>
<script src="gitbook/app.js"></script>
<script src="gitbook/plugins/gitbook-plugin-search/lunr.min.js"></script>
<script src="gitbook/plugins/gitbook-plugin-search/search.js"></script>
<script src="gitbook/plugins/gitbook-plugin-sharing/buttons.js"></script>
<script src="gitbook/plugins/gitbook-plugin-fontsettings/buttons.js"></script>
<script>
require(["gitbook"], function(gitbook) {
var config = {"highlight":{},"search":{"maxIndexSize":1000000},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2}};
gitbook.start(config);
});
</script>
</body>
</html>