Skip to Main Content
C# Cookbook, 2nd Edition
book

C# Cookbook, 2nd Edition

by Jay Hilyard, Stephen Teilhet
January 2006
Intermediate to advanced content levelIntermediate to advanced
1184 pages
43h 23m
English
O'Reilly Media, Inc.
Content preview from C# Cookbook, 2nd Edition
This is the Title of the Book, eMatter Edition
Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.
Reversing the Contents of a Sorted List
|
249
return this.keys[index];
}
private KeyList<TKey, TValue> GetKeyListHelper( )
{
if (this.keyList == null)
{
this.keyList = new KeyList<TKey, TValue>(this);
}
return this.keyList;
}
private ValueList<TKey, TValue> GetValueListHelper( )
{
if (this.valueList == null)
{
this.valueList = new ValueList<TKey, TValue>(this);
}
return this.valueList;
}
private void Insert(int index, TKey key, TValue value)
{
if (this._size == this.keys.Length)
{
this.EnsureCapacity(this._size + 1);
}
if (index < this._size)
{
Array.Copy(this.keys, index, this.keys, (int)(index + 1),
(int)(this._size - index));
Array.Copy(this.values, index, this.values, (int)(index + 1),
(int)(this._size - index));
}
this.keys[index] = key;
this.values[index] = value;
this._size++;
this.version++;
}
private void InternalSetCapacity(int value, bool updateVersion)
{
if (value != this.keys.Length)
{
if (value < this._size)
{
throw new ArgumentOutOfRangeException(
"value", "Too small capacity");
}
if (value > 0)
{
TKey[] localArray1 = new TKey[value];
Example 4-3. ReversibleSortedList class (continued)
This is the Title of the Book, eMatter Edition
Copyright © 2007 O’Reilly & ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

C# Cookbook

C# Cookbook

Stephen Teilhet, Jay Hilyard
C# Cookbook

C# Cookbook

Joe Mayo
Head First C#, 4th Edition

Head First C#, 4th Edition

Andrew Stellman, Jennifer Greene

Publisher Resources

ISBN: 0596100639Supplemental ContentCatalog PageErrata