自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(15)
  • 收藏
  • 关注

原创 python的列表数据类型

定义列表变量:name_list = ["zhangsan", "lisi", "wangwu"] num_list = [6, 8, 4, 1, 10] # 1. 取值和取索引 print(name_list [1]) # 知道数据内容,想确定数据在列表中的位置 print(name_list.index("lisi")) # 2...

2019-05-22 19:42:02 507

原创 Linux系统中,与时间相关的API/C库函数

在Linux系统中,常见的与时间相关的API或C库函数如下: char *asctime(const struct tm *tm); char *asctime_r(const struct tm *tm, char *buf); char *ctime(const time_t *timep); char *ctime_r(const time_t *timep, char *buf);...

2019-05-09 15:44:01 410

原创 希尔排序(C语言)

#define MAXSIZE 10 typedef struct { int r[MAXSIZE + 1]; int length; } /*对顺序表L做希尔排序*/ void ShellSort(SqList *L) { int i , j; int increment = L->length;/*增量*/ do{ increment = increment/3+...

2019-04-30 11:42:35 304

转载 简单选择排序以及直接插入排序(C语言)

/*两种排序算法用到的存储结构*/ sort.h #define MAXSIZE 10 typedef struct { int r[MAXSIZE +1]; int length; }SqList; /*用于交换数组中两元素的位置*/ void swap(SqList *L, int i, int j) { int temp = L->r[i]; L->r[j...

2019-04-29 14:28:27 394

原创 排序算法——冒泡算法(C语言版)

/*在sort.h文件定义用于排序的顺序表结构,如下:*/ sort.h #define MAXSIZE 10 #define true 1 #define false 0 typedef int Status; typedef struct { int r[MAXSIZE +1];/*r[0]用作哨兵或临时变量(目前还没有用到此变量的作用)*/ int length; }Sq...

2019-04-27 11:48:10 381

原创 循环队列以及链队列的实现(C语言)

#define OK 1 #define ERROR 0 #define MAXSIZE 10 typedef int Status; typedef int QElemType; #if 0 /*循环链表的存储结构*/ typedef struct { QElemType data[MAXSIZE ]; int front; int rear; }SqQueue; ...

2019-04-20 15:21:12 383

原创 栈的实现(C语言版)

Stack.h #define OK 1 #define ERROR 0 #define MAXSIZE 100 typedef int SelemType; typedef int Status; /*01 栈的顺序存储结构*/ typedef struct Sqstack { SelemType data[MAXSIZE]; int top; }sqstack; /*02...

2019-04-18 17:23:18 174

原创 顺序栈以及两栈共享空间(C语言版)

/*01 顺序栈的存储结构*/ Sqstack.h #define OK 1 #define ERROR 0 #define MAXSIZE 100 typedef int ElemType; typedef int Status; typedef struct { ElemType data[MAXSIZE]; int top; }Sqstack; Status Init...

2019-04-17 20:10:57 318

原创 循环链表(C语言版)

/*循环链表的存储结构*/ #define OK 1 #define ERROR 0 typedef int ElemType; typedef int Status; typedef struct DNode { ElemType data; struct DNode *prior; struct DNode *next; }dnode; typedef struct ...

2019-04-17 13:59:53 195

原创 循环链表(C语言版)

CircleLinkList.h #define OK 1 #define ERROR 0 typedef int Status; typedef int ElemType; typedef struct CNode { ElemType data; struct CNode *next; }cnode; typedef struct CNode *CLinkList; St...

2019-04-16 19:02:50 352

原创 Linux文件IO相关的API学习

文件IO操作相关的API函数:open、write、read、close、lseek等 下面用一个实例来对这些API函数进行说明 #include <stdio.h> #include <unistd.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h&g...

2019-04-14 17:25:10 513

原创 静态链表(C语言版)

StaticLinkList.h /*线性表的静态链表存储结构*/ #define MAXSIZE 1000/*假设链表的最大长度是1000*/ #define OK 1 #define ERROR 0 typedef int Status; typedef int ElemType; typedef struct { ElemType data; int cur;/*游标(cu...

2019-04-14 15:55:25 1101

原创 线性表的链式存储结构(单链表 C语言版)

LinkList.h #define OK 1 #define ERROR 0 typedef int Status; typedef int ElemType; /*线性表的单链表存储结构*/ typedef struct Node { ElemType data; struct Node *next; }node; typedef struct Node *LinkList...

2019-04-12 10:10:54 531

原创 无符号数与有符号数在内存中表现形式

首先讲解原码、反码和补码 无符号数按照原码来解析;有符号数按照补码来解析。 例如-1的原码:10000001;反码:11111110;补码:11111111 例如1的原码:00000001;反码:00000001;补码:00000001 #include<stdio.h> int main(void) { char a = -1; printf("%d\n", a); ...

2019-04-11 17:41:45 1625

原创 线性表的顺序存储结构(C语言版)

线性表的顺序存储结构代码 #define MAXSIZE 20 /*存储空间初始分配量*/ typedef int ElemType; /*ElemType类型根据实际情况而定,这里假设为int*/ typedef struct { ElemType data[MAXSIZE ]; /*数组存储数据元素,最大值为MAXSIZE*/ int length;...

2019-04-10 20:28:10 1160 1

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除