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
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
|
<!-- HTML header for doxygen 1.8.3.1-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.6"/>
<title>Templates -- Meow: meow::SplayTree< Key, Value > Class Template Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
$(document).ready(initResizable);
$(window).load(resizeHeight);
</script>
<link href="stylesheet.css" rel="stylesheet" type="text/css" />
<link href="custom.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectlogo"><img alt="Logo" src="logo.png"/></td>
<td style="padding-left: 0.5em;">
<div id="projectname">Templates -- Meow
 <span id="projectnumber">204.13.18</span>
</div>
<div id="projectbrief">A C++ template contains kinds of interesting classes and functions</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.6 -->
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('classmeow_1_1SplayTree.html','');});
</script>
<div id="doc-content">
<div class="header">
<div class="summary">
<a href="#nested-classes">Classes</a> |
<a href="#pub-methods">Public Member Functions</a> |
<a href="classmeow_1_1SplayTree-members.html">List of all members</a> </div>
<div class="headertitle">
<div class="title">meow::SplayTree< Key, Value > Class Template Reference</div> </div>
</div><!--header-->
<div class="contents">
<p>是一種神乎其技的資料結構, 維護一堆 Key->Value . 並且支援 一些 <code>std::map</code> 難以快速實踐的操作, 如 <code>split</code> , <code>merge</code> , <code>keyOffset</code>
<a href="classmeow_1_1SplayTree.html#details">More...</a></p>
<p><code>#include "<a class="el" href="SplayTree_8h_source.html">SplayTree.h</a>"</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Classes</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class  </td><td class="memItemRight" valign="bottom"><a class="el" href="classmeow_1_1SplayTree_1_1Element.html">Element</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft"> </td><td class="mdescRight">類似 <code>stl</code> 的 <code>iterator</code> ,不過這邊叫做<code><a class="el" href="classmeow_1_1SplayTree_1_1Element.html" title="類似 stl 的 iterator ,不過這邊叫做Element ">Element</a></code> <a href="classmeow_1_1SplayTree_1_1Element.html#details">More...</a><br/></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a640cec3815f70c0a7eac811d7272c637"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classmeow_1_1SplayTree.html#a640cec3815f70c0a7eac811d7272c637">SplayTree</a> ()</td></tr>
<tr class="memdesc:a640cec3815f70c0a7eac811d7272c637"><td class="mdescLeft"> </td><td class="mdescRight">constructor <a href="#a640cec3815f70c0a7eac811d7272c637">More...</a><br/></td></tr>
<tr class="separator:a640cec3815f70c0a7eac811d7272c637"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:addfdea993d700469785b3e01631ec3c0"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classmeow_1_1SplayTree.html#addfdea993d700469785b3e01631ec3c0">SplayTree</a> (<a class="el" href="classmeow_1_1SplayTree.html">SplayTree</a> const &tree2)</td></tr>
<tr class="memdesc:addfdea993d700469785b3e01631ec3c0"><td class="mdescLeft"> </td><td class="mdescRight">constructor, 複製資料 <a href="#addfdea993d700469785b3e01631ec3c0">More...</a><br/></td></tr>
<tr class="separator:addfdea993d700469785b3e01631ec3c0"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a8a3e10edd9aa04a5786ad6d8b7dd5490"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classmeow_1_1SplayTree.html#a8a3e10edd9aa04a5786ad6d8b7dd5490">~SplayTree</a> ()</td></tr>
<tr class="memdesc:a8a3e10edd9aa04a5786ad6d8b7dd5490"><td class="mdescLeft"> </td><td class="mdescRight">destructor <a href="#a8a3e10edd9aa04a5786ad6d8b7dd5490">More...</a><br/></td></tr>
<tr class="separator:a8a3e10edd9aa04a5786ad6d8b7dd5490"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aafc78f8d6abc95d52ba1062c14946cd5"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classmeow_1_1SplayTree.html">SplayTree</a> & </td><td class="memItemRight" valign="bottom"><a class="el" href="classmeow_1_1SplayTree.html#aafc78f8d6abc95d52ba1062c14946cd5">copyFrom</a> (<a class="el" href="classmeow_1_1SplayTree.html">SplayTree</a> const &tree2)</td></tr>
<tr class="memdesc:aafc78f8d6abc95d52ba1062c14946cd5"><td class="mdescLeft"> </td><td class="mdescRight">複製資料 <a href="#aafc78f8d6abc95d52ba1062c14946cd5">More...</a><br/></td></tr>
<tr class="separator:aafc78f8d6abc95d52ba1062c14946cd5"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a169eca2b27a5ec844bd79bba2bb75412"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classmeow_1_1SplayTree.html#a169eca2b27a5ec844bd79bba2bb75412">moveTo</a> (<a class="el" href="classmeow_1_1SplayTree.html">SplayTree</a> *tree2)</td></tr>
<tr class="memdesc:a169eca2b27a5ec844bd79bba2bb75412"><td class="mdescLeft"> </td><td class="mdescRight">將資料都丟到 <code>tree2</code> 身上, 並且清空自己 <a href="#a169eca2b27a5ec844bd79bba2bb75412">More...</a><br/></td></tr>
<tr class="separator:a169eca2b27a5ec844bd79bba2bb75412"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a48d6f8f0af07a6620bd73a92db226ce6"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classmeow_1_1SplayTree_1_1Element.html">Element</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classmeow_1_1SplayTree.html#a48d6f8f0af07a6620bd73a92db226ce6">lowerBound</a> (Key const &key) const </td></tr>
<tr class="memdesc:a48d6f8f0af07a6620bd73a92db226ce6"><td class="mdescLeft"> </td><td class="mdescRight">找出第一個(最小的) Element且 <code>k</code> <= 它的 Key, 並且回傳之. <a href="#a48d6f8f0af07a6620bd73a92db226ce6">More...</a><br/></td></tr>
<tr class="separator:a48d6f8f0af07a6620bd73a92db226ce6"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a9cd532f990a5fe6ff0930fc297cf664e"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classmeow_1_1SplayTree_1_1Element.html">Element</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classmeow_1_1SplayTree.html#a9cd532f990a5fe6ff0930fc297cf664e">upperBound</a> (Key const &key) const </td></tr>
<tr class="memdesc:a9cd532f990a5fe6ff0930fc297cf664e"><td class="mdescLeft"> </td><td class="mdescRight">找出第一個(最小的) Element且 <code>k</code> < 它的 Key, 並且回傳之. <a href="#a9cd532f990a5fe6ff0930fc297cf664e">More...</a><br/></td></tr>
<tr class="separator:a9cd532f990a5fe6ff0930fc297cf664e"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a06dd77ef9bd62d83a7571feca5324825"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classmeow_1_1SplayTree_1_1Element.html">Element</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classmeow_1_1SplayTree.html#a06dd77ef9bd62d83a7571feca5324825">rLowerBound</a> (Key const &key) const </td></tr>
<tr class="memdesc:a06dd77ef9bd62d83a7571feca5324825"><td class="mdescLeft"> </td><td class="mdescRight">找出第一個(最小的) Element且 <code>k</code> >= 它的 Key, 並且回傳之. <a href="#a06dd77ef9bd62d83a7571feca5324825">More...</a><br/></td></tr>
<tr class="separator:a06dd77ef9bd62d83a7571feca5324825"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a7e4eb9104cd7a2c01cda7e0a19c55cbe"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classmeow_1_1SplayTree_1_1Element.html">Element</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classmeow_1_1SplayTree.html#a7e4eb9104cd7a2c01cda7e0a19c55cbe">rUpperBound</a> (Key const &key) const </td></tr>
<tr class="memdesc:a7e4eb9104cd7a2c01cda7e0a19c55cbe"><td class="mdescLeft"> </td><td class="mdescRight">找出第一個(最小的) Element且 <code>k</code> > 它的 Key, 並且回傳之. <a href="#a7e4eb9104cd7a2c01cda7e0a19c55cbe">More...</a><br/></td></tr>
<tr class="separator:a7e4eb9104cd7a2c01cda7e0a19c55cbe"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a67dc7214cf9a89053e4b719f4d60cb4c"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classmeow_1_1SplayTree_1_1Element.html">Element</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classmeow_1_1SplayTree.html#a67dc7214cf9a89053e4b719f4d60cb4c">find</a> (Key const &key) const </td></tr>
<tr class="memdesc:a67dc7214cf9a89053e4b719f4d60cb4c"><td class="mdescLeft"> </td><td class="mdescRight">找出 Key= <code>k</code> 的Elemenet 並回傳. 找不到的話回傳 <code>this-><a class="el" href="classmeow_1_1SplayTree.html#abcdab5caa27fecfd980595681381a4dc" title="回傳一個指向NULL的Element, ">end()</a></code> <a href="#a67dc7214cf9a89053e4b719f4d60cb4c">More...</a><br/></td></tr>
<tr class="separator:a67dc7214cf9a89053e4b719f4d60cb4c"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ad91ceed4303b4fc5b115b067d304debc"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classmeow_1_1SplayTree_1_1Element.html">Element</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classmeow_1_1SplayTree.html#ad91ceed4303b4fc5b115b067d304debc">order</a> (size_t order) const </td></tr>
<tr class="memdesc:ad91ceed4303b4fc5b115b067d304debc"><td class="mdescLeft"> </td><td class="mdescRight">將Elements依照Key由小到大排序, 回傳第 <code>ord</code> 個Element (由0算起). <a href="#ad91ceed4303b4fc5b115b067d304debc">More...</a><br/></td></tr>
<tr class="separator:ad91ceed4303b4fc5b115b067d304debc"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ad8c3814cbfbcc9f754b62a74368ddc0b"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classmeow_1_1SplayTree_1_1Element.html">Element</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classmeow_1_1SplayTree.html#ad8c3814cbfbcc9f754b62a74368ddc0b">first</a> () const </td></tr>
<tr class="memdesc:ad8c3814cbfbcc9f754b62a74368ddc0b"><td class="mdescLeft"> </td><td class="mdescRight">回傳Key最小的Element, 如果SplayTree為空, 則回傳 <code>this-><a class="el" href="classmeow_1_1SplayTree.html#abcdab5caa27fecfd980595681381a4dc" title="回傳一個指向NULL的Element, ">end()</a></code> <a href="#ad8c3814cbfbcc9f754b62a74368ddc0b">More...</a><br/></td></tr>
<tr class="separator:ad8c3814cbfbcc9f754b62a74368ddc0b"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a805efe9b5f4bac68fd62908eb7cf3501"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classmeow_1_1SplayTree_1_1Element.html">Element</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classmeow_1_1SplayTree.html#a805efe9b5f4bac68fd62908eb7cf3501">last</a> () const </td></tr>
<tr class="memdesc:a805efe9b5f4bac68fd62908eb7cf3501"><td class="mdescLeft"> </td><td class="mdescRight">回傳Key最大的Element, 如果SplayTree為空, 則回傳 <code>this-><a class="el" href="classmeow_1_1SplayTree.html#abcdab5caa27fecfd980595681381a4dc" title="回傳一個指向NULL的Element, ">end()</a></code> <a href="#a805efe9b5f4bac68fd62908eb7cf3501">More...</a><br/></td></tr>
<tr class="separator:a805efe9b5f4bac68fd62908eb7cf3501"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:abcdab5caa27fecfd980595681381a4dc"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classmeow_1_1SplayTree_1_1Element.html">Element</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classmeow_1_1SplayTree.html#abcdab5caa27fecfd980595681381a4dc">end</a> () const </td></tr>
<tr class="memdesc:abcdab5caa27fecfd980595681381a4dc"><td class="mdescLeft"> </td><td class="mdescRight">回傳一個指向NULL的Element, <a href="#abcdab5caa27fecfd980595681381a4dc">More...</a><br/></td></tr>
<tr class="separator:abcdab5caa27fecfd980595681381a4dc"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a40b663d34933b258e667f9205f469fdc"><td class="memItemLeft" align="right" valign="top">size_t </td><td class="memItemRight" valign="bottom"><a class="el" href="classmeow_1_1SplayTree.html#a40b663d34933b258e667f9205f469fdc">size</a> () const </td></tr>
<tr class="memdesc:a40b663d34933b258e667f9205f469fdc"><td class="mdescLeft"> </td><td class="mdescRight">回傳資料個數 <a href="#a40b663d34933b258e667f9205f469fdc">More...</a><br/></td></tr>
<tr class="separator:a40b663d34933b258e667f9205f469fdc"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a8dac8bccc08f9c1c828b25b7fe9919c7"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classmeow_1_1SplayTree.html#a8dac8bccc08f9c1c828b25b7fe9919c7">empty</a> () const </td></tr>
<tr class="memdesc:a8dac8bccc08f9c1c828b25b7fe9919c7"><td class="mdescLeft"> </td><td class="mdescRight">回傳是否為空 <a href="#a8dac8bccc08f9c1c828b25b7fe9919c7">More...</a><br/></td></tr>
<tr class="separator:a8dac8bccc08f9c1c828b25b7fe9919c7"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ae5a57883fd31a6288b958b42b94606a9"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classmeow_1_1SplayTree.html#ae5a57883fd31a6288b958b42b94606a9">clear</a> ()</td></tr>
<tr class="memdesc:ae5a57883fd31a6288b958b42b94606a9"><td class="mdescLeft"> </td><td class="mdescRight">清空 <a href="#ae5a57883fd31a6288b958b42b94606a9">More...</a><br/></td></tr>
<tr class="separator:ae5a57883fd31a6288b958b42b94606a9"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a0ae5e48da8d18ad8b2dc839d1c1b5582"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classmeow_1_1SplayTree.html#a0ae5e48da8d18ad8b2dc839d1c1b5582">insert</a> (Key const &key, Value const &value)</td></tr>
<tr class="memdesc:a0ae5e48da8d18ad8b2dc839d1c1b5582"><td class="mdescLeft"> </td><td class="mdescRight">插入一組<code></code>(Key —> <code>Value</code>) <a href="#a0ae5e48da8d18ad8b2dc839d1c1b5582">More...</a><br/></td></tr>
<tr class="separator:a0ae5e48da8d18ad8b2dc839d1c1b5582"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aef1f4e901e3e17a67e45aa2b9f9b61db"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classmeow_1_1SplayTree.html#aef1f4e901e3e17a67e45aa2b9f9b61db">erase</a> (Key const &key)</td></tr>
<tr class="memdesc:aef1f4e901e3e17a67e45aa2b9f9b61db"><td class="mdescLeft"> </td><td class="mdescRight">刪除一組資料 <a href="#aef1f4e901e3e17a67e45aa2b9f9b61db">More...</a><br/></td></tr>
<tr class="separator:aef1f4e901e3e17a67e45aa2b9f9b61db"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aead0d2eba7528aeff12f6c0f87c60917"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classmeow_1_1SplayTree.html#aead0d2eba7528aeff12f6c0f87c60917">keyOffset</a> (Key const &delta)</td></tr>
<tr class="memdesc:aead0d2eba7528aeff12f6c0f87c60917"><td class="mdescLeft"> </td><td class="mdescRight">將所有Element的Key同加上 <code>delta</code> <a href="#aead0d2eba7528aeff12f6c0f87c60917">More...</a><br/></td></tr>
<tr class="separator:aead0d2eba7528aeff12f6c0f87c60917"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a36a55daf9150ae2d866075dedf1d583d"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classmeow_1_1SplayTree.html#a36a55daf9150ae2d866075dedf1d583d">splitOut</a> (Key const &upper_bound, <a class="el" href="classmeow_1_1SplayTree.html">SplayTree</a> *right)</td></tr>
<tr class="memdesc:a36a55daf9150ae2d866075dedf1d583d"><td class="mdescLeft"> </td><td class="mdescRight">將<code>tree2</code> 清空, 再將所有Key > <code>upper_bound</code> 的Element都丟過去 <a href="#a36a55daf9150ae2d866075dedf1d583d">More...</a><br/></td></tr>
<tr class="separator:a36a55daf9150ae2d866075dedf1d583d"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a17f0fea3a3f4c7a548743bee7e5a285c"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classmeow_1_1SplayTree.html#a17f0fea3a3f4c7a548743bee7e5a285c">mergeAfter</a> (<a class="el" href="classmeow_1_1SplayTree.html">SplayTree</a> *tree2)</td></tr>
<tr class="memdesc:a17f0fea3a3f4c7a548743bee7e5a285c"><td class="mdescLeft"> </td><td class="mdescRight">合併 <a href="#a17f0fea3a3f4c7a548743bee7e5a285c">More...</a><br/></td></tr>
<tr class="separator:a17f0fea3a3f4c7a548743bee7e5a285c"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a9d370115877428e58b1595458dc345a3"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classmeow_1_1SplayTree.html#a9d370115877428e58b1595458dc345a3">merge</a> (<a class="el" href="classmeow_1_1SplayTree.html">SplayTree</a> *tree2)</td></tr>
<tr class="memdesc:a9d370115877428e58b1595458dc345a3"><td class="mdescLeft"> </td><td class="mdescRight">合併 <a href="#a9d370115877428e58b1595458dc345a3">More...</a><br/></td></tr>
<tr class="separator:a9d370115877428e58b1595458dc345a3"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a9f02a4ccc46616b7923c5834e02d53bc"><td class="memItemLeft" align="right" valign="top">Value & </td><td class="memItemRight" valign="bottom"><a class="el" href="classmeow_1_1SplayTree.html#a9f02a4ccc46616b7923c5834e02d53bc">operator[]</a> (Key const &key)</td></tr>
<tr class="memdesc:a9f02a4ccc46616b7923c5834e02d53bc"><td class="mdescLeft"> </td><td class="mdescRight">就像<code>stl::map::operator</code>[] <a href="#a9f02a4ccc46616b7923c5834e02d53bc">More...</a><br/></td></tr>
<tr class="separator:a9f02a4ccc46616b7923c5834e02d53bc"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aef1da0d72d3a88851bd805d489fb6ea0"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classmeow_1_1SplayTree.html">SplayTree</a> & </td><td class="memItemRight" valign="bottom"><a class="el" href="classmeow_1_1SplayTree.html#aef1da0d72d3a88851bd805d489fb6ea0">operator=</a> (<a class="el" href="classmeow_1_1SplayTree.html">SplayTree</a> const &tree2)</td></tr>
<tr class="memdesc:aef1da0d72d3a88851bd805d489fb6ea0"><td class="mdescLeft"> </td><td class="mdescRight">same as <code>copyFrom(tree2)</code> <a href="#aef1da0d72d3a88851bd805d489fb6ea0">More...</a><br/></td></tr>
<tr class="separator:aef1da0d72d3a88851bd805d489fb6ea0"><td class="memSeparator" colspan="2"> </td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><h3>template<class Key, class Value><br/>
class meow::SplayTree< Key, Value ></h3>
<p>是一種神乎其技的資料結構, 維護一堆 Key->Value . 並且支援 一些 <code>std::map</code> 難以快速實踐的操作, 如 <code>split</code> , <code>merge</code> , <code>keyOffset</code> </p>
<h2>Template Class Operators Request </h2>
<table class="doxtable">
<tr>
<th align="right">const?</th><th align="center">Typename</th><th align="right">Operator </th><th align="left">Parameters </th><th align="center">Return Type </th><th align="left">Description </th></tr>
<tr>
<td align="right">const </td><td align="center">Key </td><td align="right">operator+ </td><td align="left">(Key <code>k</code>) </td><td align="center">Key </td><td align="left">相加 </td></tr>
<tr>
<td align="right">const </td><td align="center">Key </td><td align="right">operator< </td><td align="left">(Key <code>k</code>) </td><td align="center">bool </td><td align="left">大小比較 </td></tr>
<tr>
<td align="right"></td><td align="center">Key </td><td align="right">operator= </td><td align="left">(Key <code>k</code>) </td><td align="center">Key </td><td align="left">copy oper </td></tr>
<tr>
<td align="right"></td><td align="center">Key </td><td align="right">Key </td><td align="left">(int <code>n</code>) </td><td align="center"></td><td align="left">構子,<code>n</code> 永遠是0 </td></tr>
<tr>
<td align="right"></td><td align="center">Value </td><td align="right">Value </td><td align="left">( ) </td><td align="center"></td><td align="left">建構子 </td></tr>
</table>
<dl class="section note"><dt>Note</dt><dd>: -假設現在有兩個SplayTree <code>A</code> 和 <code>B</code>, 則: -執行 <code>B.moveTo(&A)</code> 後 <code>B</code> 會變成空的, <code>A</code> 原本擁有的資料也會覆蓋掉 -行 <code>A.merge(&B)</code> 或 <code>A.mergeAfter(&B)</code> 後 如果檢查發現確實可以merge, 則之後 <code>B</code> 會變成空的</dd></dl>
<dl class="section author"><dt>Author</dt><dd>cat_leopard </dd></dl>
<p>Definition at line <a class="el" href="SplayTree_8h_source.html#l00037">37</a> of file <a class="el" href="SplayTree_8h_source.html">SplayTree.h</a>.</p>
</div><h2 class="groupheader">Constructor & Destructor Documentation</h2>
<a class="anchor" id="a640cec3815f70c0a7eac811d7272c637"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template<class Key , class Value > </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classmeow_1_1SplayTree.html">meow::SplayTree</a>< Key, Value >::<a class="el" href="classmeow_1_1SplayTree.html">SplayTree</a> </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>constructor </p>
<p>Definition at line <a class="el" href="SplayTree_8h_source.html#l00253">253</a> of file <a class="el" href="SplayTree_8h_source.html">SplayTree.h</a>.</p>
</div>
</div>
<a class="anchor" id="addfdea993d700469785b3e01631ec3c0"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template<class Key , class Value > </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classmeow_1_1SplayTree.html">meow::SplayTree</a>< Key, Value >::<a class="el" href="classmeow_1_1SplayTree.html">SplayTree</a> </td>
<td>(</td>
<td class="paramtype"><a class="el" href="classmeow_1_1SplayTree.html">SplayTree</a>< Key, Value > const & </td>
<td class="paramname"><em>tree2</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>constructor, 複製資料 </p>
<p>Definition at line <a class="el" href="SplayTree_8h_source.html#l00257">257</a> of file <a class="el" href="SplayTree_8h_source.html">SplayTree.h</a>.</p>
</div>
</div>
<a class="anchor" id="a8a3e10edd9aa04a5786ad6d8b7dd5490"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template<class Key , class Value > </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classmeow_1_1SplayTree.html">meow::SplayTree</a>< Key, Value >::~<a class="el" href="classmeow_1_1SplayTree.html">SplayTree</a> </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>destructor </p>
<p>Definition at line <a class="el" href="SplayTree_8h_source.html#l00262">262</a> of file <a class="el" href="SplayTree_8h_source.html">SplayTree.h</a>.</p>
</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="ae5a57883fd31a6288b958b42b94606a9"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template<class Key , class Value > </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void <a class="el" href="classmeow_1_1SplayTree.html">meow::SplayTree</a>< Key, Value >::clear </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>清空 </p>
<p>Definition at line <a class="el" href="SplayTree_8h_source.html#l00400">400</a> of file <a class="el" href="SplayTree_8h_source.html">SplayTree.h</a>.</p>
</div>
</div>
<a class="anchor" id="aafc78f8d6abc95d52ba1062c14946cd5"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template<class Key , class Value > </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classmeow_1_1SplayTree.html">SplayTree</a>& <a class="el" href="classmeow_1_1SplayTree.html">meow::SplayTree</a>< Key, Value >::copyFrom </td>
<td>(</td>
<td class="paramtype"><a class="el" href="classmeow_1_1SplayTree.html">SplayTree</a>< Key, Value > const & </td>
<td class="paramname"><em>tree2</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>複製資料 </p>
<p>Definition at line <a class="el" href="SplayTree_8h_source.html#l00269">269</a> of file <a class="el" href="SplayTree_8h_source.html">SplayTree.h</a>.</p>
</div>
</div>
<a class="anchor" id="a8dac8bccc08f9c1c828b25b7fe9919c7"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template<class Key , class Value > </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">bool <a class="el" href="classmeow_1_1SplayTree.html">meow::SplayTree</a>< Key, Value >::empty </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>回傳是否為空 </p>
<p>Definition at line <a class="el" href="SplayTree_8h_source.html#l00393">393</a> of file <a class="el" href="SplayTree_8h_source.html">SplayTree.h</a>.</p>
</div>
</div>
<a class="anchor" id="abcdab5caa27fecfd980595681381a4dc"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template<class Key , class Value > </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classmeow_1_1SplayTree_1_1Element.html">Element</a> <a class="el" href="classmeow_1_1SplayTree.html">meow::SplayTree</a>< Key, Value >::end </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>回傳一個指向NULL的Element, </p>
<p>以供 <code>find</code> ,<code>order</code> ,<code>first</code> ,<code>last</code> 等判斷是否有找到相對應的Element </p>
<p>Definition at line <a class="el" href="SplayTree_8h_source.html#l00379">379</a> of file <a class="el" href="SplayTree_8h_source.html">SplayTree.h</a>.</p>
</div>
</div>
<a class="anchor" id="aef1f4e901e3e17a67e45aa2b9f9b61db"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template<class Key , class Value > </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">bool <a class="el" href="classmeow_1_1SplayTree.html">meow::SplayTree</a>< Key, Value >::erase </td>
<td>(</td>
<td class="paramtype">Key const & </td>
<td class="paramname"><em>key</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>刪除一組資料 </p>
<p>檢查是否已有Element的Key 為 <code>key</code>, 若有則刪除之, 並回傳 <code>true</code>, 否則則回傳 <code>false</code> </p>
<p>Definition at line <a class="el" href="SplayTree_8h_source.html#l00435">435</a> of file <a class="el" href="SplayTree_8h_source.html">SplayTree.h</a>.</p>
</div>
</div>
<a class="anchor" id="a67dc7214cf9a89053e4b719f4d60cb4c"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template<class Key , class Value > </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classmeow_1_1SplayTree_1_1Element.html">Element</a> <a class="el" href="classmeow_1_1SplayTree.html">meow::SplayTree</a>< Key, Value >::find </td>
<td>(</td>
<td class="paramtype">Key const & </td>
<td class="paramname"><em>key</em></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>找出 Key= <code>k</code> 的Elemenet 並回傳. 找不到的話回傳 <code>this-><a class="el" href="classmeow_1_1SplayTree.html#abcdab5caa27fecfd980595681381a4dc" title="回傳一個指向NULL的Element, ">end()</a></code> </p>
<p>Definition at line <a class="el" href="SplayTree_8h_source.html#l00339">339</a> of file <a class="el" href="SplayTree_8h_source.html">SplayTree.h</a>.</p>
</div>
</div>
<a class="anchor" id="ad8c3814cbfbcc9f754b62a74368ddc0b"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template<class Key , class Value > </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classmeow_1_1SplayTree_1_1Element.html">Element</a> <a class="el" href="classmeow_1_1SplayTree.html">meow::SplayTree</a>< Key, Value >::first </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>回傳Key最小的Element, 如果SplayTree為空, 則回傳 <code>this-><a class="el" href="classmeow_1_1SplayTree.html#abcdab5caa27fecfd980595681381a4dc" title="回傳一個指向NULL的Element, ">end()</a></code> </p>
<p>Definition at line <a class="el" href="SplayTree_8h_source.html#l00361">361</a> of file <a class="el" href="SplayTree_8h_source.html">SplayTree.h</a>.</p>
</div>
</div>
<a class="anchor" id="a0ae5e48da8d18ad8b2dc839d1c1b5582"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template<class Key , class Value > </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">bool <a class="el" href="classmeow_1_1SplayTree.html">meow::SplayTree</a>< Key, Value >::insert </td>
<td>(</td>
<td class="paramtype">Key const & </td>
<td class="paramname"><em>key</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">Value const & </td>
<td class="paramname"><em>value</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>插入一組<code></code>(Key —> <code>Value</code>) </p>
<p>檢查是否已有Element的Key 為 <code>key</code>, 若有則回傳 <code>false</code> , 否則將 一個 (Key -> Value) = (<code>key</code> -> <code>value</code>)的Element加入, 並回傳 <code>true</code> </p>
<p>Definition at line <a class="el" href="SplayTree_8h_source.html#l00411">411</a> of file <a class="el" href="SplayTree_8h_source.html">SplayTree.h</a>.</p>
</div>
</div>
<a class="anchor" id="aead0d2eba7528aeff12f6c0f87c60917"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template<class Key , class Value > </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void <a class="el" href="classmeow_1_1SplayTree.html">meow::SplayTree</a>< Key, Value >::keyOffset </td>
<td>(</td>
<td class="paramtype">Key const & </td>
<td class="paramname"><em>delta</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>將所有Element的Key同加上 <code>delta</code> </p>
<p>Definition at line <a class="el" href="SplayTree_8h_source.html#l00468">468</a> of file <a class="el" href="SplayTree_8h_source.html">SplayTree.h</a>.</p>
</div>
</div>
<a class="anchor" id="a805efe9b5f4bac68fd62908eb7cf3501"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template<class Key , class Value > </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classmeow_1_1SplayTree_1_1Element.html">Element</a> <a class="el" href="classmeow_1_1SplayTree.html">meow::SplayTree</a>< Key, Value >::last </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>回傳Key最大的Element, 如果SplayTree為空, 則回傳 <code>this-><a class="el" href="classmeow_1_1SplayTree.html#abcdab5caa27fecfd980595681381a4dc" title="回傳一個指向NULL的Element, ">end()</a></code> </p>
<p>Definition at line <a class="el" href="SplayTree_8h_source.html#l00369">369</a> of file <a class="el" href="SplayTree_8h_source.html">SplayTree.h</a>.</p>
</div>
</div>
<a class="anchor" id="a48d6f8f0af07a6620bd73a92db226ce6"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template<class Key , class Value > </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classmeow_1_1SplayTree_1_1Element.html">Element</a> <a class="el" href="classmeow_1_1SplayTree.html">meow::SplayTree</a>< Key, Value >::lowerBound </td>
<td>(</td>
<td class="paramtype">Key const & </td>
<td class="paramname"><em>key</em></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>找出第一個(最小的) Element且 <code>k</code> <= 它的 Key, 並且回傳之. </p>
<p>找不到的話回傳 <code>this-><a class="el" href="classmeow_1_1SplayTree.html#abcdab5caa27fecfd980595681381a4dc" title="回傳一個指向NULL的Element, ">end()</a></code> </p>
<p>Definition at line <a class="el" href="SplayTree_8h_source.html#l00289">289</a> of file <a class="el" href="SplayTree_8h_source.html">SplayTree.h</a>.</p>
</div>
</div>
<a class="anchor" id="a9d370115877428e58b1595458dc345a3"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template<class Key , class Value > </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">bool <a class="el" href="classmeow_1_1SplayTree.html">meow::SplayTree</a>< Key, Value >::merge </td>
<td>(</td>
<td class="paramtype"><a class="el" href="classmeow_1_1SplayTree.html">SplayTree</a>< Key, Value > * </td>
<td class="paramname"><em>tree2</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>合併 </p>
<p>檢查是否自己中的 Key 都小於 <code>tree2</code> 中的Key, 或是完全相反, 是的話把 <code>tree2`中的</code> <a class="el" href="classmeow_1_1SplayTree_1_1Element.html" title="類似 stl 的 iterator ,不過這邊叫做Element ">Element</a> 都搬到自己這, 同時清空 <code>tree2</code> , 否則回傳 <code>false</code> </p>
<p>Definition at line <a class="el" href="SplayTree_8h_source.html#l00511">511</a> of file <a class="el" href="SplayTree_8h_source.html">SplayTree.h</a>.</p>
</div>
</div>
<a class="anchor" id="a17f0fea3a3f4c7a548743bee7e5a285c"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template<class Key , class Value > </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">bool <a class="el" href="classmeow_1_1SplayTree.html">meow::SplayTree</a>< Key, Value >::mergeAfter </td>
<td>(</td>
<td class="paramtype"><a class="el" href="classmeow_1_1SplayTree.html">SplayTree</a>< Key, Value > * </td>
<td class="paramname"><em>tree2</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>合併 </p>
<p>檢查是否自己中的 Key 都小於 <code>tree2</code> 中的Key, 是的話把 <code>tree2`</code> 中的 <a class="el" href="classmeow_1_1SplayTree_1_1Element.html" title="類似 stl 的 iterator ,不過這邊叫做Element ">Element</a> 都搬到自己這, 同時清空 <code>tree2</code> , 否則回傳 <code>false</code> </p>
<p>Definition at line <a class="el" href="SplayTree_8h_source.html#l00494">494</a> of file <a class="el" href="SplayTree_8h_source.html">SplayTree.h</a>.</p>
</div>
</div>
<a class="anchor" id="a169eca2b27a5ec844bd79bba2bb75412"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template<class Key , class Value > </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void <a class="el" href="classmeow_1_1SplayTree.html">meow::SplayTree</a>< Key, Value >::moveTo </td>
<td>(</td>
<td class="paramtype"><a class="el" href="classmeow_1_1SplayTree.html">SplayTree</a>< Key, Value > * </td>
<td class="paramname"><em>tree2</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>將資料都丟到 <code>tree2</code> 身上, 並且清空自己 </p>
<p>Definition at line <a class="el" href="SplayTree_8h_source.html#l00278">278</a> of file <a class="el" href="SplayTree_8h_source.html">SplayTree.h</a>.</p>
</div>
</div>
<a class="anchor" id="aef1da0d72d3a88851bd805d489fb6ea0"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template<class Key , class Value > </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classmeow_1_1SplayTree.html">SplayTree</a>& <a class="el" href="classmeow_1_1SplayTree.html">meow::SplayTree</a>< Key, Value >::operator= </td>
<td>(</td>
<td class="paramtype"><a class="el" href="classmeow_1_1SplayTree.html">SplayTree</a>< Key, Value > const & </td>
<td class="paramname"><em>tree2</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>same as <code>copyFrom(tree2)</code> </p>
<p>Definition at line <a class="el" href="SplayTree_8h_source.html#l00538">538</a> of file <a class="el" href="SplayTree_8h_source.html">SplayTree.h</a>.</p>
</div>
</div>
<a class="anchor" id="a9f02a4ccc46616b7923c5834e02d53bc"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template<class Key , class Value > </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">Value& <a class="el" href="classmeow_1_1SplayTree.html">meow::SplayTree</a>< Key, Value >::operator[] </td>
<td>(</td>
<td class="paramtype">Key const & </td>
<td class="paramname"><em>key</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>就像<code>stl::map::operator</code>[] </p>
<p>會先檢查是否已有Element的Key 為 <code>key</code>, 若有則回傳相對應的Value的Reference 否則先執行 <code>insert(key,Value())</code> 再回傳相對應的Reference </p>
<p>Definition at line <a class="el" href="SplayTree_8h_source.html#l00532">532</a> of file <a class="el" href="SplayTree_8h_source.html">SplayTree.h</a>.</p>
</div>
</div>
<a class="anchor" id="ad91ceed4303b4fc5b115b067d304debc"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template<class Key , class Value > </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classmeow_1_1SplayTree_1_1Element.html">Element</a> <a class="el" href="classmeow_1_1SplayTree.html">meow::SplayTree</a>< Key, Value >::order </td>
<td>(</td>
<td class="paramtype">size_t </td>
<td class="paramname"><em>order</em></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>將Elements依照Key由小到大排序, 回傳第 <code>ord</code> 個Element (由0算起). </p>
<p>其中如果 <code>ord>N-1</code>, 則會回傳 <code>this-><a class="el" href="classmeow_1_1SplayTree.html#a805efe9b5f4bac68fd62908eb7cf3501" title="回傳Key最大的Element, 如果SplayTree為空, 則回傳 this->end() ">last()</a></code> </p>
<p>Definition at line <a class="el" href="SplayTree_8h_source.html#l00352">352</a> of file <a class="el" href="SplayTree_8h_source.html">SplayTree.h</a>.</p>
</div>
</div>
<a class="anchor" id="a06dd77ef9bd62d83a7571feca5324825"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template<class Key , class Value > </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classmeow_1_1SplayTree_1_1Element.html">Element</a> <a class="el" href="classmeow_1_1SplayTree.html">meow::SplayTree</a>< Key, Value >::rLowerBound </td>
<td>(</td>
<td class="paramtype">Key const & </td>
<td class="paramname"><em>key</em></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>找出第一個(最小的) Element且 <code>k</code> >= 它的 Key, 並且回傳之. </p>
<p>找不到的話回傳 <code>this-><a class="el" href="classmeow_1_1SplayTree.html#abcdab5caa27fecfd980595681381a4dc" title="回傳一個指向NULL的Element, ">end()</a></code> </p>
<p>Definition at line <a class="el" href="SplayTree_8h_source.html#l00315">315</a> of file <a class="el" href="SplayTree_8h_source.html">SplayTree.h</a>.</p>
</div>
</div>
<a class="anchor" id="a7e4eb9104cd7a2c01cda7e0a19c55cbe"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template<class Key , class Value > </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classmeow_1_1SplayTree_1_1Element.html">Element</a> <a class="el" href="classmeow_1_1SplayTree.html">meow::SplayTree</a>< Key, Value >::rUpperBound </td>
<td>(</td>
<td class="paramtype">Key const & </td>
<td class="paramname"><em>key</em></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>找出第一個(最小的) Element且 <code>k</code> > 它的 Key, 並且回傳之. </p>
<p>找不到的話回傳 <code>this-><a class="el" href="classmeow_1_1SplayTree.html#abcdab5caa27fecfd980595681381a4dc" title="回傳一個指向NULL的Element, ">end()</a></code> </p>
<p>Definition at line <a class="el" href="SplayTree_8h_source.html#l00328">328</a> of file <a class="el" href="SplayTree_8h_source.html">SplayTree.h</a>.</p>
</div>
</div>
<a class="anchor" id="a40b663d34933b258e667f9205f469fdc"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template<class Key , class Value > </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">size_t <a class="el" href="classmeow_1_1SplayTree.html">meow::SplayTree</a>< Key, Value >::size </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>回傳資料個數 </p>
<p>Definition at line <a class="el" href="SplayTree_8h_source.html#l00386">386</a> of file <a class="el" href="SplayTree_8h_source.html">SplayTree.h</a>.</p>
</div>
</div>
<a class="anchor" id="a36a55daf9150ae2d866075dedf1d583d"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template<class Key , class Value > </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void <a class="el" href="classmeow_1_1SplayTree.html">meow::SplayTree</a>< Key, Value >::splitOut </td>
<td>(</td>
<td class="paramtype">Key const & </td>
<td class="paramname"><em>upper_bound</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="classmeow_1_1SplayTree.html">SplayTree</a>< Key, Value > * </td>
<td class="paramname"><em>right</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>將<code>tree2</code> 清空, 再將所有Key > <code>upper_bound</code> 的Element都丟過去 </p>
<p>Definition at line <a class="el" href="SplayTree_8h_source.html#l00477">477</a> of file <a class="el" href="SplayTree_8h_source.html">SplayTree.h</a>.</p>
</div>
</div>
<a class="anchor" id="a9cd532f990a5fe6ff0930fc297cf664e"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template<class Key , class Value > </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classmeow_1_1SplayTree_1_1Element.html">Element</a> <a class="el" href="classmeow_1_1SplayTree.html">meow::SplayTree</a>< Key, Value >::upperBound </td>
<td>(</td>
<td class="paramtype">Key const & </td>
<td class="paramname"><em>key</em></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>找出第一個(最小的) Element且 <code>k</code> < 它的 Key, 並且回傳之. </p>
<p>找不到的話回傳 <code>this-><a class="el" href="classmeow_1_1SplayTree.html#abcdab5caa27fecfd980595681381a4dc" title="回傳一個指向NULL的Element, ">end()</a></code> </p>
<p>Definition at line <a class="el" href="SplayTree_8h_source.html#l00302">302</a> of file <a class="el" href="SplayTree_8h_source.html">SplayTree.h</a>.</p>
</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>meowpp/dsa/<a class="el" href="SplayTree_8h_source.html">SplayTree.h</a></li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- HTML footer for doxygen 1.8.3.1-->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="namespacemeow.html">meow</a></li><li class="navelem"><a class="el" href="classmeow_1_1SplayTree.html">SplayTree</a></li>
<li class="footer">Generated on Tue Jun 24 2014 03:53:32 for Templates -- Meow by
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.6 </li>
</ul>
</div>
</body>
</html>
|