public List <List <double> > SortString([FromBody] SortTask <double> sortTask) { if (sortTask == null) { Response.StatusCode = 400; return(null); } return(_repo.SortList(sortTask)); }
public List <List <int> > SortInteger([FromBody] SortTask <int> sortTask) { if (sortTask == null) { Response.StatusCode = 400; return(null); } return(_repo.SortList(sortTask)); }
public List <List <double> > SortList(SortTask <double> sContext) { switch (sContext.SortType) { case SortType.Quick: return(QuickSort(sContext.ListToSort)); case SortType.Bubble: return(BubbleSort(sContext.ListToSort)); case SortType.Bucket: return(BucketSort(sContext.ListToSort)); default: return(null); } }
/// <summary> /// Sorts a list and returns snapshots of each sort stage /// </summary> public List <List <int> > SortList(SortTask <int> sContext) { switch (sContext.SortType) { case SortType.Quick: List <List <int> > snapShotList = new List <List <int> >(); return(QuickSort(sContext.ListToSort)); case SortType.Bubble: return(BubbleSort(sContext.ListToSort)); case SortType.Bucket: return(BucketSort(sContext.ListToSort)); default: return(null); } }