-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathSortFunction.h
More file actions
61 lines (36 loc) · 1.65 KB
/
Copy pathSortFunction.h
File metadata and controls
61 lines (36 loc) · 1.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#pragma once
const int MAX_ARRAY_ELEMENT_LENGTH = 100;
typedef int ElementType;
typedef struct _Sequence_
{
ElementType data[MAX_ARRAY_ELEMENT_LENGTH];
int elem_num;
}SequenceList;
typedef struct _SequenceWithSentinel_
{
ElementType data[MAX_ARRAY_ELEMENT_LENGTH + 1];
int elem_num;
}SequenceWithSentinel;
int helper_swap(ElementType *ele1, ElementType *ele2);
int init_sequence(SequenceList *pList);
int input_sequence(SequenceList *pList);
int print_sequence(SequenceList *pList);
int init_sequence(SequenceWithSentinel *seq_array);
int input_sequence(SequenceWithSentinel *seq_array);
int print_sequence(SequenceWithSentinel *seq_array);
int swap_sort(SequenceWithSentinel *seq_array);
int bubble_sort(SequenceWithSentinel *seq_array);
int bubble_sort_with_optimization(SequenceWithSentinel *seq_array);
int simple_selection_sort(SequenceWithSentinel *seq_array);
int heap_sort(SequenceWithSentinel *seq_array);
int heap_adjust(ElementType data[], int low, int high);
int straight_insertion_sort(SequenceWithSentinel *seq_array);
int shell_sort(SequenceWithSentinel *seq_array);
int quick_sort(SequenceList *pSqList);
int quick_sort_subseq(ElementType data[], int low, int high);
int quick_sort_partition(ElementType data[], int low, int high);
int merge_sort_recursive(SequenceList *seq_list);
int merge_sort_recursive_subseq(ElementType data_from[], ElementType data_to[], int low, int high);
int merge_sort_iterative(SequenceList *seq_list);
int merge_sort_iterative_step(ElementType data_in[], ElementType data_out[], int step, int length);
int merge_sort_basic(ElementType data_in[], ElementType data_out[], int low, int mid, int high);