- 博客(13)
- 资源 (3)
- 收藏
- 关注
原创 二分查找
/*供暖器*//* 房屋:[1,2,3],供暖器:[2],半径:1 房屋:[1,2,3,4],供暖器:[1,4],半径:1 房屋:[1,5],供暖器:[2],半径:3*/#include <stdlib.h>#include <stdio.h>/*二分法*/#define MAX(a,b) ((a) > (b) ? (a) : (b))#define MIN(a,b) ((a) < (b) ? (a) : (b))int bin.
2022-03-09 18:11:39
177
原创 vscode 隐藏非imx6ull文件
CV正点原子文件u-boot//settings.json uboot{ "search.exclude": { "**/node_modules": true, "**/bower_components": true, "**/*.o":true, "**/*.su":true, "**/*.cmd":true, "arch/arc":true, "arch/
2022-02-16 19:46:04
107
原创 斐波那契--爬楼梯
f(n)=f(n-1)+f(n-2)#include <stdlib.h>#include <stdio.h>int climbStairs(int n){ int p = 0,q = 0,r = 1; for (int i = 1; i <= n; i++) { p = q; q = r; r = p + q; printf(" %d ",r); } ret.
2022-02-09 15:16:28
503
原创 最大子数组和
#include <stdlib.h>#include <stdio.h>#define MAX(a,b) ((a)>(b)?(a):(b))int maxSubArray1(int *nums,int numsSize){ int pre = 0,maxAns = nums[0]; for (int i = 0; i < numsSize; i++) { pre = MAX(pre+nums[i],nums[i]);.
2022-02-09 11:31:54
190
原创 最长字符串
#include <stdlib.h>#include <stdio.h>#include <string.h>#define MAX(a ,b) ((a)<(b)? (b):(a))int lengthOfLongestSubstring2(char * s){ int hash[127] = {0}; int left = 0,right = 0,max =0; while(s[right]) { .
2022-02-09 11:00:23
794
原创 sqort()排序
#include <stdlib.h>标准库,快速排序。/* Sort NMEMB elements of BASE, of SIZE bytes each, using COMPAR to perform the comparisons. */extern void qsort (void *__base, size_t __nmemb, size_t __size, __compar_fn_t __compar) __nonnull ((1, 4));#if.
2022-01-28 15:14:55
891
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人