This commit is contained in:
Saturneic 2019-01-03 16:42:03 +08:00
parent 9c51d27d1b
commit 16b326b177
3 changed files with 19 additions and 17 deletions

View File

@ -11,6 +11,15 @@
*: 0,-1.*/ *: 0,-1.*/
static int sortList(List *p_list, unsigned long long begin, unsigned long long end, int(*func)(Node *f_node, Node *s_node)); static int sortList(List *p_list, unsigned long long begin, unsigned long long end, int(*func)(Node *f_node, Node *s_node));
/**
@param p_list
@param begin
@param end
@param func
@return 0
*/
static int sortList(List *p_list, unsigned long long begin, unsigned long long end, int(*func)(Node *f_node, Node *s_node)){ static int sortList(List *p_list, unsigned long long begin, unsigned long long end, int(*func)(Node *f_node, Node *s_node)){
unsigned long long target_index = begin; unsigned long long target_index = begin;
register Node *t_node = findByIndexForNode(p_list, target_index); register Node *t_node = findByIndexForNode(p_list, target_index);
@ -41,6 +50,15 @@ static int sortList(List *p_list, unsigned long long begin, unsigned long long e
return 0; return 0;
} }
/**
@param p_list
@param func
@return 0
*/
int sortListForCustom(List *p_list, int(*func)(Node *f_node, Node *s_node)){ int sortListForCustom(List *p_list, int(*func)(Node *f_node, Node *s_node)){
#ifdef list_quick_enable #ifdef list_quick_enable
if(p_list->p_lq != NULL && !p_list->p_lq->if_sort) p_list->p_lq->if_sort = 1; if(p_list->p_lq != NULL && !p_list->p_lq->if_sort) p_list->p_lq->if_sort = 1;

View File

@ -47,19 +47,6 @@ int list(void) {
return 0; return 0;
}*/ }*/
int stack(void) {
int i;
Stack *t_stack = initStack();
for (i = 0; i < 10; i++) {
pushStack(t_stack, snodeWithInt(i));
}
for (i = 0; i < 10; i++) {
printf("%d", getValueByIntForSNode(popStack(t_stack)));
}
releaseStack(t_stack);
return 0;
}
int time_avg(void){ int time_avg(void){
List *t_list = initList(0); List *t_list = initList(0);
int64_t time_all = 0; int64_t time_all = 0;

View File

@ -9,10 +9,7 @@
#include <list/list_expand.h> #include <list/list_expand.h>
#include <list/list_expand_1.h> #include <list/list_expand_1.h>
#include <list/list_quick.h> #include <list/list_quick.h>
#include <stack/stack.h> #include <communicate/communicate.h>
#include <stack/stack_expand.h>
//#include "tree/tree_expand.h"
#include "communicate/communicate.h"
int stack(void); int stack(void);
int list(void); int list(void);