
数据结构
安排一下么
这个作者很懒,什么都没留下…
展开
-
数据结构——线性表的实现(增删部分)
#include<stdio.h> #include<stdlib.h> #define LIST_INIT_SIZE 10 #define LISTINCREMENT 10 typedef int ElemType; typedef int Status; typedef struct { ElemType *elem; int length;//当前长度 int list原创 2017-11-13 20:43:15 · 502 阅读 · 0 评论 -
求最大子列和(时间复杂度分别为O(n3) O(n2) O(n))
#include<stdio.h> #include<math.h> #pragma warning(disable:4996) int Three(const int A[], int N); int Two(const int A[], int N); int One(const int A[], int N); int Max(int MaxLeftSum, int MaxRightSum,原创 2017-11-14 18:10:57 · 1546 阅读 · 0 评论 -
二分查找(时间复杂度为O(logn))
//二分查找函数 int BinarySearch(const int A[], int X, int N) { int Low, Mid, High; Low = 0; High = N - 1; while (Low <= High) { Mid = (Low + High) / 2; if (A[Mid] < X) {原创 2017-11-15 11:49:03 · 1106 阅读 · 0 评论