风萧28

2020年5月12日

C 链表合并

摘要: #include <stdio.h> #include <stdlib.h> typedef struct node{ int data; //占4B struct node *next; //占8B } List; //共占16B List* creatLink(int li[], int n)  阅读全文

posted @ 2020-05-12 11:35 小流江海 阅读(238) 评论(0) 推荐(0) 编辑

2019年6月17日

快排

摘要: 1.python快排 def get_pivot(li,left,right): mid = (left+right)//2 if li[left] > li[right]: li[left],li[right] = li[right],li[left] if li[left] > li[mid]: 阅读全文

posted @ 2019-06-17 21:25 小流江海 阅读(258) 评论(0) 推荐(0) 编辑

2019年6月16日

python排序

摘要: import random def bubble_sort(li): for i in range(len(li)-1): exch_flag = False for j in range(len(li)-i-1): if li[j+1] =0 and tmp li[left]: left += 1 ... 阅读全文

posted @ 2019-06-16 16:48 小流江海 阅读(200) 评论(0) 推荐(0) 编辑

C语言排序

摘要: void swap(int *x, int *y){ int tmp; tmp = *x; *x = *y; *y = tmp; } void insert_sort(int *array, int n){ int i; for (i=1;i=0 && tmp array[j+1]){ swap(&array[j],... 阅读全文

posted @ 2019-06-16 16:45 小流江海 阅读(207) 评论(0) 推荐(0) 编辑

C语言计时

摘要: 1.time(NULL) 计时最小单位为s 2.time.h 3.windows.h 显示ms数 阅读全文

posted @ 2019-06-16 16:44 小流江海 阅读(755) 评论(0) 推荐(0) 编辑

2019年6月14日

time模块

摘要: import time # print(time.time()) #返回时间戳 # print(time.localtime()) #返回元组形式 返回当地时间 # print(time.gmtime()) #返回元组形式 返回utc时区 # print(time.timezone) # print(time.gmtime(1540... 阅读全文

posted @ 2019-06-14 00:23 小流江海 阅读(132) 评论(0) 推荐(0) 编辑

2019年6月10日

大端对齐 和小端对齐

摘要: 大端对齐:高内存地址放整数高位 ,低内存地址放整数低位 例如x86 arm都是采用大端对齐 小端对其:高内存地址放整数低位, 低内存地址放整数高位 例如unix大型服务器 阅读全文

posted @ 2019-06-10 22:05 小流江海 阅读(1067) 评论(0) 推荐(0) 编辑

2019年3月11日

python之生成器与迭代器

摘要: 生成器 列表生成式:li = [i for i in range(10)] 将列表生成式中[]换成()即为生成器generator 生成器保存的对象不是具体的数,而是一种算法,一种推导式,调用__next__()可以计算出下一个元素,没有更多的元素时,抛出StopIteration的错误 迭代器 可 阅读全文

posted @ 2019-03-11 17:58 小流江海 阅读(206) 评论(0) 推荐(0) 编辑

2019年2月24日

python之字符串反转

摘要: 1.反向循环迭代 2.反转列表 将字符串转换为列表,反转列表,将列表转换为字符串 3.反向循环迭代 4.列表弹出发 阅读全文

posted @ 2019-02-24 21:36 小流江海 阅读(236) 评论(0) 推荐(0) 编辑

2019年2月22日

简单排序

摘要: 1 # Author:Json 2 3 class Sort(object): 4 ''' 5 this class include bubble sort,insert sort,select sort,quick sort,merge sort and heap sort 6 ''' 7 8 def __init__(sel... 阅读全文

posted @ 2019-02-22 17:44 小流江海 阅读(223) 评论(0) 推荐(0) 编辑

导航