83
83
84
84
< h1 id ="Advanced_Algorithms_DataStructures_Dictionary_2 " data-uid ="Advanced.Algorithms.DataStructures.Dictionary`2 " class ="text-break "> Class Dictionary<TK, TV>
85
85
</ h1 >
86
- < div class ="markdown level0 summary "> < p > A hash table implementation (key value dictionary) with separate chaining </ p >
86
+ < div class ="markdown level0 summary "> < p > A dictionary implementation. </ p >
87
87
</ div >
88
88
< div class ="markdown level0 conceptual "> </ div >
89
89
< div class ="inheritance ">
@@ -93,7 +93,7 @@ <h5>Inheritance</h5>
93
93
</ div >
94
94
< div classs ="implements ">
95
95
< h5 > Implements</ h5 >
96
- < div > < a class ="xref " href ="https://docs.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1 "> IEnumerable</ a > << a class ="xref " href ="Advanced.Algorithms.DataStructures.DictionaryNode-2.html " > DictionaryNode </ a > <TK, TV>></ div >
96
+ < div > < a class ="xref " href ="https://docs.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1 "> IEnumerable</ a > << a class ="xref " href ="https://docs.microsoft.com/dotnet/api/system.collections.generic.keyvaluepair-2 " > KeyValuePair </ a > <TK, TV>></ div >
97
97
< div > < a class ="xref " href ="https://docs.microsoft.com/dotnet/api/system.collections.ienumerable "> IEnumerable</ a > </ div >
98
98
</ div >
99
99
< div class ="inheritedMembers ">
@@ -124,7 +124,7 @@ <h6><strong>Namespace</strong>: <a class="xref" href="Advanced.Algorithms.DataSt
124
124
< h6 > < strong > Assembly</ strong > : Advanced.Algorithms.dll</ h6 >
125
125
< h5 id ="Advanced_Algorithms_DataStructures_Dictionary_2_syntax "> Syntax</ h5 >
126
126
< div class ="codewrapper ">
127
- < pre > < code class ="lang-csharp hljs "> public class Dictionary<TK, TV> : IEnumerable<DictionaryNode <TK, TV>>, IEnumerable</ code > </ pre >
127
+ < pre > < code class ="lang-csharp hljs "> public class Dictionary<TK, TV> : IEnumerable<KeyValuePair <TK, TV>>, IEnumerable</ code > </ pre >
128
128
</ div >
129
129
< h5 class ="typeParameters "> Type Parameters</ h5 >
130
130
< table class ="table table-bordered table-striped table-condensed ">
@@ -141,7 +141,8 @@ <h5 class="typeParameters">Type Parameters</h5>
141
141
</ tr >
142
142
< tr >
143
143
< td > < span class ="parametername "> TV</ span > </ td >
144
- < td > </ td >
144
+ < td > < p > The value datatype.</ p >
145
+ </ td >
145
146
</ tr >
146
147
</ tbody >
147
148
</ table >
@@ -151,7 +152,8 @@ <h3 id="constructors">Constructors
151
152
152
153
< a id ="Advanced_Algorithms_DataStructures_Dictionary_2__ctor_ " data-uid ="Advanced.Algorithms.DataStructures.Dictionary`2.#ctor* "> </ a >
153
154
< h4 id ="Advanced_Algorithms_DataStructures_Dictionary_2__ctor_Advanced_Algorithms_DataStructures_DictionaryType_System_Int32_ " data-uid ="Advanced.Algorithms.DataStructures.Dictionary`2.#ctor(Advanced.Algorithms.DataStructures.DictionaryType,System.Int32) "> Dictionary(DictionaryType, Int32)</ h4 >
154
- < div class ="markdown level1 summary "> </ div >
155
+ < div class ="markdown level1 summary "> < p > Constructor.</ p >
156
+ </ div >
155
157
< div class ="markdown level1 conceptual "> </ div >
156
158
< h5 class ="decalaration "> Declaration</ h5 >
157
159
< div class ="codewrapper ">
@@ -170,12 +172,14 @@ <h5 class="parameters">Parameters</h5>
170
172
< tr >
171
173
< td > < a class ="xref " href ="Advanced.Algorithms.DataStructures.DictionaryType.html "> DictionaryType</ a > </ td >
172
174
< td > < span class ="parametername "> type</ span > </ td >
173
- < td > </ td >
175
+ < td > < p > The dictionary implementation to use.</ p >
176
+ </ td >
174
177
</ tr >
175
178
< tr >
176
179
< td > < a class ="xref " href ="https://docs.microsoft.com/dotnet/api/system.int32 "> Int32</ a > </ td >
177
180
< td > < span class ="parametername "> initialBucketSize</ span > </ td >
178
- < td > </ td >
181
+ < td > < p > The larger the bucket size lesser the collision, but memory matters!</ p >
182
+ </ td >
179
183
</ tr >
180
184
</ tbody >
181
185
</ table >
@@ -185,7 +189,8 @@ <h3 id="properties">Properties
185
189
186
190
< a id ="Advanced_Algorithms_DataStructures_Dictionary_2_Count_ " data-uid ="Advanced.Algorithms.DataStructures.Dictionary`2.Count* "> </ a >
187
191
< h4 id ="Advanced_Algorithms_DataStructures_Dictionary_2_Count " data-uid ="Advanced.Algorithms.DataStructures.Dictionary`2.Count "> Count</ h4 >
188
- < div class ="markdown level1 summary "> </ div >
192
+ < div class ="markdown level1 summary "> < p > The number of items in this hashset.</ p >
193
+ </ div >
189
194
< div class ="markdown level1 conceptual "> </ div >
190
195
< h5 class ="decalaration "> Declaration</ h5 >
191
196
< div class ="codewrapper ">
@@ -210,7 +215,9 @@ <h5 class="propertyValue">Property Value</h5>
210
215
211
216
< a id ="Advanced_Algorithms_DataStructures_Dictionary_2_Item_ " data-uid ="Advanced.Algorithms.DataStructures.Dictionary`2.Item* "> </ a >
212
217
< h4 id ="Advanced_Algorithms_DataStructures_Dictionary_2_Item__0_ " data-uid ="Advanced.Algorithms.DataStructures.Dictionary`2.Item(`0) "> Item[TK]</ h4 >
213
- < div class ="markdown level1 summary "> </ div >
218
+ < div class ="markdown level1 summary "> < p > Get/set value for given key.
219
+ Time complexity: O(1) amortized.</ p >
220
+ </ div >
214
221
< div class ="markdown level1 conceptual "> </ div >
215
222
< h5 class ="decalaration "> Declaration</ h5 >
216
223
< div class ="codewrapper ">
@@ -254,7 +261,9 @@ <h3 id="methods">Methods
254
261
255
262
< a id ="Advanced_Algorithms_DataStructures_Dictionary_2_Add_ " data-uid ="Advanced.Algorithms.DataStructures.Dictionary`2.Add* "> </ a >
256
263
< h4 id ="Advanced_Algorithms_DataStructures_Dictionary_2_Add__0__1_ " data-uid ="Advanced.Algorithms.DataStructures.Dictionary`2.Add(`0,`1) "> Add(TK, TV)</ h4 >
257
- < div class ="markdown level1 summary "> </ div >
264
+ < div class ="markdown level1 summary "> < p > Add a new key for given value.
265
+ Time complexity: O(1) amortized.</ p >
266
+ </ div >
258
267
< div class ="markdown level1 conceptual "> </ div >
259
268
< h5 class ="decalaration "> Declaration</ h5 >
260
269
< div class ="codewrapper ">
@@ -273,20 +282,23 @@ <h5 class="parameters">Parameters</h5>
273
282
< tr >
274
283
< td > < span class ="xref "> TK</ span > </ td >
275
284
< td > < span class ="parametername "> key</ span > </ td >
276
- < td > </ td >
285
+ < td > < p > The key to add.</ p >
286
+ </ td >
277
287
</ tr >
278
288
< tr >
279
289
< td > < span class ="xref "> TV</ span > </ td >
280
290
< td > < span class ="parametername "> value</ span > </ td >
281
- < td > </ td >
291
+ < td > < p > The value for the given key.</ p >
292
+ </ td >
282
293
</ tr >
283
294
</ tbody >
284
295
</ table >
285
296
286
297
287
298
< a id ="Advanced_Algorithms_DataStructures_Dictionary_2_Clear_ " data-uid ="Advanced.Algorithms.DataStructures.Dictionary`2.Clear* "> </ a >
288
299
< h4 id ="Advanced_Algorithms_DataStructures_Dictionary_2_Clear " data-uid ="Advanced.Algorithms.DataStructures.Dictionary`2.Clear "> Clear()</ h4 >
289
- < div class ="markdown level1 summary "> < p > clear hash table</ p >
300
+ < div class ="markdown level1 summary "> < p > Clear the dictionary.
301
+ Time complexity: O(1).</ p >
290
302
</ div >
291
303
< div class ="markdown level1 conceptual "> </ div >
292
304
< h5 class ="decalaration "> Declaration</ h5 >
@@ -297,7 +309,9 @@ <h5 class="decalaration">Declaration</h5>
297
309
298
310
< a id ="Advanced_Algorithms_DataStructures_Dictionary_2_ContainsKey_ " data-uid ="Advanced.Algorithms.DataStructures.Dictionary`2.ContainsKey* "> </ a >
299
311
< h4 id ="Advanced_Algorithms_DataStructures_Dictionary_2_ContainsKey__0_ " data-uid ="Advanced.Algorithms.DataStructures.Dictionary`2.ContainsKey(`0) "> ContainsKey(TK)</ h4 >
300
- < div class ="markdown level1 summary "> </ div >
312
+ < div class ="markdown level1 summary "> < p > Does this dictionary contains the given key.
313
+ Time complexity: O(1) amortized.</ p >
314
+ </ div >
301
315
< div class ="markdown level1 conceptual "> </ div >
302
316
< h5 class ="decalaration "> Declaration</ h5 >
303
317
< div class ="codewrapper ">
@@ -331,7 +345,8 @@ <h5 class="returns">Returns</h5>
331
345
< tbody >
332
346
< tr >
333
347
< td > < a class ="xref " href ="https://docs.microsoft.com/dotnet/api/system.boolean "> Boolean</ a > </ td >
334
- < td > </ td >
348
+ < td > < p > True if this dictionary contains the given key.</ p >
349
+ </ td >
335
350
</ tr >
336
351
</ tbody >
337
352
</ table >
@@ -343,7 +358,7 @@ <h4 id="Advanced_Algorithms_DataStructures_Dictionary_2_GetEnumerator" data-uid=
343
358
< div class ="markdown level1 conceptual "> </ div >
344
359
< h5 class ="decalaration "> Declaration</ h5 >
345
360
< div class ="codewrapper ">
346
- < pre > < code class ="lang-csharp hljs "> public IEnumerator<DictionaryNode <TK, TV>> GetEnumerator()</ code > </ pre >
361
+ < pre > < code class ="lang-csharp hljs "> public IEnumerator<KeyValuePair <TK, TV>> GetEnumerator()</ code > </ pre >
347
362
</ div >
348
363
< h5 class ="returns "> Returns</ h5 >
349
364
< table class ="table table-bordered table-striped table-condensed ">
@@ -355,7 +370,7 @@ <h5 class="returns">Returns</h5>
355
370
</ thead >
356
371
< tbody >
357
372
< tr >
358
- < td > < a class ="xref " href ="https://docs.microsoft.com/dotnet/api/system.collections.generic.ienumerator-1 "> IEnumerator</ a > << a class ="xref " href ="Advanced.Algorithms.DataStructures.DictionaryNode-2.html " > DictionaryNode </ a > <TK, TV>></ td >
373
+ < td > < a class ="xref " href ="https://docs.microsoft.com/dotnet/api/system.collections.generic.ienumerator-1 "> IEnumerator</ a > << a class ="xref " href ="https://docs.microsoft.com/dotnet/api/system.collections.generic.keyvaluepair-2 " > KeyValuePair </ a > <TK, TV>></ td >
359
374
< td > </ td >
360
375
</ tr >
361
376
</ tbody >
@@ -364,7 +379,9 @@ <h5 class="returns">Returns</h5>
364
379
365
380
< a id ="Advanced_Algorithms_DataStructures_Dictionary_2_Remove_ " data-uid ="Advanced.Algorithms.DataStructures.Dictionary`2.Remove* "> </ a >
366
381
< h4 id ="Advanced_Algorithms_DataStructures_Dictionary_2_Remove__0_ " data-uid ="Advanced.Algorithms.DataStructures.Dictionary`2.Remove(`0) "> Remove(TK)</ h4 >
367
- < div class ="markdown level1 summary "> </ div >
382
+ < div class ="markdown level1 summary "> < p > Remove the given key along with its value.
383
+ Time complexity: O(1) amortized.</ p >
384
+ </ div >
368
385
< div class ="markdown level1 conceptual "> </ div >
369
386
< h5 class ="decalaration "> Declaration</ h5 >
370
387
< div class ="codewrapper ">
@@ -383,7 +400,8 @@ <h5 class="parameters">Parameters</h5>
383
400
< tr >
384
401
< td > < span class ="xref "> TK</ span > </ td >
385
402
< td > < span class ="parametername "> key</ span > </ td >
386
- < td > </ td >
403
+ < td > < p > The key to remove.</ p >
404
+ </ td >
387
405
</ tr >
388
406
</ tbody >
389
407
</ table >
0 commit comments