
Algorithm
小马识图
这个作者很懒,什么都没留下…
展开
-
sorting - quick sort
#include "stdio.h" #include "string.h"#define MAX_LIST 50 typedef struct _SqList { int data[MAX_LIST]; int length; }SqList;void swap( SqList* L, unsigned index1, unsigned index2 ) { if( in原创 2015-03-25 00:47:01 · 774 阅读 · 0 评论 -
sorting - select sort
#include "stdio.h" #include "string.h"#define MAX_LIST 50 typedef struct _SqList { int data[MAX_LIST]; int length; }SqList;void swap( SqList* L, unsigned index1, unsigned index2 ) { if( in原创 2015-03-24 00:38:01 · 492 阅读 · 0 评论 -
sorting - shell sort
#include "stdio.h" #include "string.h"#define MAX_LIST 50 typedef struct _SqList { int data[MAX_LIST]; int length; }SqList;void swap( SqList* L, unsigned index1, unsigned index2 ) { if( in原创 2015-03-24 02:52:10 · 570 阅读 · 0 评论 -
sorting - insert sort
include “stdio.h”include “string.h”define MAX_LIST 50typedef struct _SqList { int data[MAX_LIST]; int length; }SqList;void swap( SqList* L, unsigned index1, unsigned index2 ) { if( in原创 2015-03-24 01:05:58 · 583 阅读 · 0 评论 -
Sorting - heap sort
#include "stdio.h" #include "string.h"#define MAX_LIST 50 typedef struct _SqList { int data[MAX_LIST]; int length; }SqList;void swap( SqList* L, unsigned index1, unsigned index2 ) { if( in原创 2015-03-23 01:37:21 · 522 阅读 · 0 评论 -
Sorting - bubble sort
#include "stdio.h" #include "string.h"#define MAX_LIST 50 typedef struct _SqList { int data[MAX_LIST]; int length; }SqList;void swap( SqList* L, unsigned index1, unsigned index2 ) { if( in原创 2015-03-23 02:12:50 · 557 阅读 · 0 评论 -
search - binary search
#include "stdio.h" #include "string.h"#define MAX_LIST 50typedef struct _SqList { int data[MAX_LIST]; int length; }SqList;int BinarySearch( SqList* L, int key ) { int low = 0; int high原创 2015-03-30 01:32:21 · 428 阅读 · 0 评论 -
search - fibonacci search
#include "stdio.h" #include "string.h" #include "malloc.h" #define MAX_LIST 50typedef struct _SqList { int data[MAX_LIST]; int length; }SqList;//The key difference between Fibonacci search and原创 2015-03-30 03:01:36 · 748 阅读 · 0 评论 -
sorting - merge sort
#include "stdio.h" #include "string.h"#define MAX_LIST 50 typedef struct _SqList { int data[MAX_LIST]; int length; }SqList;enum MERGE_SORT_METHOD { RECURSE, ITERATE };void Merge( int src[], int原创 2015-03-28 03:45:25 · 522 阅读 · 0 评论 -
search - binary search/sort tree
#include "stdio.h" #include "stdlib.h" #include "string.h"//What is a Binary Sort Tree? //1. A BST is either an empty tree or a binary tree with the following characteristics //2. all elements on left原创 2015-04-15 03:08:35 · 576 阅读 · 0 评论