two types of template
2008-10-23 13:02
232 查看
template<class T,int len>
void QuickSort(T (&list)[len],int left,int right)
{
if(left>=right)
return;
int mid=RandomPartition(list,left,right);
QuickSort(list,left,mid-1);
QuickSort(list,mid+1,right);
}
template<class T>
void QuickSort(T *list,int left,int right)
{
if(left>=right)
return;
int mid=RandomPartition(list,left,right);
QuickSort(list,left,mid-1);
QuickSort(list,mid+1,right);
}
void QuickSort(T (&list)[len],int left,int right)
{
if(left>=right)
return;
int mid=RandomPartition(list,left,right);
QuickSort(list,left,mid-1);
QuickSort(list,mid+1,right);
}
template<class T>
void QuickSort(T *list,int left,int right)
{
if(left>=right)
return;
int mid=RandomPartition(list,left,right);
QuickSort(list,left,mid-1);
QuickSort(list,mid+1,right);
}
相关文章推荐
- LInux C语言错误 two or more data types in declaration of `main'
- Codeforces Round #437 (Div. 2 C. Ordering Pizza 贪心 only two types of pizza
- Codeforces Round #437 (Div. 2 C. Ordering Pizza 贪心 only two types of pizza
- two or more data types in declaration of 错误
- Codeforces Round #437 (Div. 2 C. Ordering Pizza 贪心 only two types of pizza
- Codeforces Round #437 (Div. 2 C. Ordering Pizza 贪心 only two types of pizza
- Codeforces Round #437 (Div. 2 C. Ordering Pizza 贪心 only two types of pizza
- Two Types of Hongxing Double Jaw Crusher
- Error: two or more data types in declaration of `main'
- Codeforces Round #437 (Div. 2 C. Ordering Pizza 贪心 only two types of pizza
- Codeforces Round #437 (Div. 2 C. Ordering Pizza 贪心 only two types of pizza
- two or more data types in declaration of `函数名'的报错
- two+or+more+data+types+in+declaration+of+`main'
- The Two Types of Programmers
- 《Two Dozen Short Lessons in Haskell》学习(九)- Types of Curried Forms and Higher Order Functions
- Codeforces Round #437 (Div. 2 C. Ordering Pizza 贪心 only two types of pizza
- Codeforces Round #437 (Div. 2 C. Ordering Pizza 贪心 only two types of pizza
- Codeforces Round #437 (Div. 2 C. Ordering Pizza 贪心 only two types of pizza
- Codeforces Round #437 (Div. 2 C. Ordering Pizza 贪心 only two types of pizza
- Hackintosh on Two Types of PC