摘要: 1 #define _CRT_SECURE_NO_WARNINGS 1 2 #include <stdio.h> 3 #include <stdlib.h> 4 #include <string.h> 5 #include <assert.h> 6 #include <stddef.h> 7 8 9 阅读全文
posted @ 2022-03-07 20:44 小团熙 阅读(42) 评论(0) 推荐(0)
摘要: 1 #define _CRT_SECURE_NO_WARNINGS 1 2 #include <stdio.h> 3 #include <string.h> 4 #include <assert.h> 5 #include <stdlib.h> 6 #include <ctype.h> 7 //模拟 阅读全文
posted @ 2022-03-06 21:24 小团熙 阅读(48) 评论(0) 推荐(0)
摘要: 1 #define _CRT_SECURE_NO_WARNINGS 1 2 #include <stdio.h> 3 #include <stdlib.h> 4 #include <string.h> 5 #include <assert.h> 6 int main() 7 { 8 unsigned 阅读全文
posted @ 2022-03-05 21:52 小团熙 阅读(33) 评论(0) 推荐(0)
摘要: 1 #define _CRT_SECURE_NO_WARNINGS 1 2 #include <stdio.h> 3 #include <stdlib.h> 4 #include <string.h> 5 #include <math.h> 6 //int main() 7 //{ 8 // int 阅读全文
posted @ 2022-03-04 22:42 小团熙 阅读(53) 评论(0) 推荐(0)
摘要: 1 #define _CRT_SECURE_NO_WARNINGS 1 2 #include <stdio.h> 3 #include <stdlib.h> 4 #include <string.h> 5 //void Swap(char* buf1, char*buf2,int width) 6 阅读全文
posted @ 2022-03-03 22:11 小团熙 阅读(37) 评论(0) 推荐(0)
摘要: #define _CRT_SECURE_NO_WARNINGS 1#include <stdio.h>#include <stdlib.h>//int main()//{// int *p = NULL;//p 是整型指针 - 指向整型的指针 - 可以存放整型的地址// char* pc = NUL 阅读全文
posted @ 2022-03-02 22:03 小团熙 阅读(23) 评论(0) 推荐(0)
摘要: #define _CRT_SECURE_NO_WARNINGS 1#include <stdio.h>#include <windows.h>//int main()//{// int a = 10;//向内存申请 4 个字节// float f = 10.0;//向内存申请 4 个字节//// r 阅读全文
posted @ 2022-03-01 18:09 小团熙 阅读(25) 评论(0) 推荐(0)
摘要: #define _CRT_SECURE_NO_WARNINGS 1#include <stdio.h>#include <stdlib.h>#include <assert.h>//int main()//{// int i = 0;// for (i = 0; i < 100; i++)// {/ 阅读全文
posted @ 2022-02-28 17:45 小团熙 阅读(23) 评论(0) 推荐(0)
摘要: #define _CRT_SECURE_NO_WARNINGS 1#include <stdio.h>#include <string.h> int count_bit_one(unsigned int n){ int count = 0; //算法一 /*while (n) { if (n % 2 阅读全文
posted @ 2022-02-27 18:33 小团熙 阅读(57) 评论(0) 推荐(0)
摘要: 第一题:在长度为 n 的有序链表中进行查找,最坏情况下需要比较的次数为 n 。解析:最坏情况--查找的元素为表中最后一个元素或查找的元素中不再表中,则需要比较表中所有元素, 所以最坏情况下需要比较次数为 n 。 知识点2:对长度为 n 的线性表进行快速排序,最坏情况下需要比较的次数为 n(n-1)/ 阅读全文
posted @ 2022-01-23 13:17 小团熙 阅读(326) 评论(0) 推荐(0)