AVL tree/Managed C++: Difference between revisions
m
→Code: Fixed syntax highlighting.
No edit summary |
m (→Code: Fixed syntax highlighting.) |
||
(5 intermediate revisions by 3 users not shown) | |||
Line 1:
==
<
// AVL in Managed C++
using namespace System;
using namespace System::Collections;
Line 10 ⟶ 9:
using namespace System::Runtime::Serialization;
namespace
{
Line 163 ⟶ 162:
generic<typename T>
Cloner<T>^ Cloner<T>::Invisible::get() { return gcnew DefaultNoCloner<T>(); }
public ref struct OutOfKeyOrderException : public Exception
{
Line 169:
OutOfKeyOrderException() : Exception(message)
{
HelpLink = gcnew String("
Source = gcnew String("
}
};
Line 180:
TreeInvalidParentException() : Exception(message)
{
HelpLink = gcnew String("
Source = gcnew String("
}
};
Line 191:
TreeOutOfBalanceException() : Exception(message)
{
HelpLink = gcnew String("
Source = gcnew String("
}
};
Line 202:
InvalidEmptyTreeException() : Exception(message)
{
HelpLink = gcnew String("
Source = gcnew String("
}
};
Line 214:
InvalidEndItemException() : Exception(message)
{
HelpLink = gcnew String("
Source = gcnew String("
}
};
Line 225:
EntryAlreadyExistsException() : Exception(message)
{
HelpLink = gcnew String("
Source = gcnew String("
}
};
Line 236:
DifferentKeysException() : Exception(message)
{
HelpLink = gcnew String("
Source = gcnew String("
}
};
Line 247:
AddSubTreeFailedException() : Exception(message)
{
HelpLink = gcnew String("
Source = gcnew String("
}
};
Line 258:
IsEndItemException() : Exception(message)
{
HelpLink = gcnew String("
Source = gcnew String("
}
};
Line 269:
EntryNotFoundException() : Exception(message)
{
HelpLink = gcnew String("
Source = gcnew String("
}
};
Line 280:
InvalidSetOperationException() : Exception(message)
{
HelpLink = gcnew String("
Source = gcnew String("
}
};
Line 1,014:
Header = gcnew Node();
TComparer = System::Collections::Generic::Comparer<T>::Default;
TCloner =
THasher =
}
Line 1,023:
Header = gcnew Node();
TComparer = TCompare;
TCloner =
THasher =
}
Line 1,042:
Header = gcnew Node();
TComparer = System::Collections::Generic::Comparer<T>::Default;
TCloner =
THasher =
for each (T t in Collection) Add(TCloner->Clone(t));
Line 1,053:
Header = gcnew Node();
TComparer = System::Collections::Generic::Comparer<T>::Default;
TCloner =
THasher =
for each (T t in Collection) Add(TCloner->Clone(t));
Line 1,065:
Header = gcnew Node();
TComparer = TCompare;
TCloner =
THasher =
for each (T t in Collection) Add(TCloner->Clone(t));
Line 1,087:
Nodes=0;
System::Collections::Generic::IComparer<T>^ TCompare = (System::Collections::Generic::IComparer<T>^)si->GetValue("TComparer", System::Collections::Generic::IComparer<T>::typeid);
Header = gcnew Node();
Line 1,394:
virtual void GetObjectData(SerializationInfo^ si, StreamingContext sc)
{
si->SetType(
Type^ type = T::typeid;
Line 2,013:
{
System::Collections::Generic::IComparer<T>^ TComparer = R->TComparer;
SetEntry<T> first1 = A->Begin;
Line 2,245:
}
using namespace
int main(array<System::String ^> ^args)
Line 2,255:
return 0;
}
</syntaxhighlight>
|