- 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);
- }
two types of template
最新推荐文章于 2024-06-08 18:15:43 发布