|
|
1.1 ! root 1: #import <objc/Object.h> ! 2: ! 3: #define BUBBLE_SORT 0 /* Unique constants for each sort */ ! 4: #define INSERTION_SORT 1 ! 5: #define MERGE_SORT 2 ! 6: #define QUICK_SORT 3 ! 7: #define SELECTION_SORT 4 ! 8: #define SHELL_SORT 5 ! 9: #define NUM_SORT_TYPES 6 ! 10: ! 11: @interface SortController:Object ! 12: { ! 13: id sortWindow; /* window that display sorting */ ! 14: id windowHeader; /* Box object of window header */ ! 15: id sort[NUM_SORT_TYPES]; /* array of sort objects */ ! 16: BOOL sortOn[NUM_SORT_TYPES];/* array of booleans for sorts on/off */ ! 17: BOOL parallel; /* boolean to signal series or parallel */ ! 18: int numSorts; /* number of sorts scheduled for this trial */ ! 19: int sortsFinished; /* number of sorts finished in this trial */ ! 20: int numElements; /* number of elements in the data set */ ! 21: int percentSorted; /* percentage of the data that is pre-sorted */ ! 22: } ! 23: ! 24: /* INIT METHODS */ ! 25: - init; ! 26: ! 27: /* TARGET-ACTION METHODS */ ! 28: - changeAnimate:sender; ! 29: - changeDataSet:sender; ! 30: - changeParallel:sender; ! 31: - changeSortOn:sender; ! 32: - changeTickValue:sender; ! 33: ! 34: /* TEXT DELEGATE METHODS */ ! 35: - (BOOL)textWillEnd:textObject; ! 36: ! 37: /* PRIVATE METHODS */ ! 38: - setUpWindow; ! 39: - (int *)newDataSet; ! 40: - setUpData; ! 41: ! 42: /* PUBLIC METHODS */ ! 43: - (BOOL)startSort; ! 44: - sortFinished:(int)sortNum; ! 45: - findSortWithNum:(int)sortNum; ! 46: ! 47: ! 48: @end
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.