- 博客(4)
- 收藏
- 关注
原创 25-困难- K 个一组翻转链表[C语言]
struct ListNode* reverseList(struct ListNode* head, int len) { if(head == NULL || len < 2) return head; struct ListNode* tail = head; while(--len){ if(tail->next == NULL) return head; tail = tail->n.
2020-11-11 00:41:28 96
原创 8-中等-字符串转换整数 (自动机)[C语言]
enum{ Start = 0, Sign, In_num, End }; int get_col(char c) { if (c == ' ') return 0; if (c == '+' || c == '-') return 1; if ('0' <= c && c <= '9') return 2; return 3; } const int table[4][4]={\ {Start,Sig.
2020-11-09 21:03:21 93
原创 4-困难-寻找两个正序数组的中位数(二分法)[C语言]
#define max(a, b) (((a) >= (b)) ? (a) : (b)) #define min(a, b) (((a) <= (b)) ? (a) : (b)) #define LMax1 (nums1[mid1-1]) #define LMax2 (nums2[mid2-1]) #define RMin1 (nums1[mid1]) #define RMin2 (nums2[mid2]) double findMedianSortedArrays(int* nums1..
2020-10-15 01:58:05 297
原创 [C语言] 数组 快速排序 (带随机生成测试用例)
#include <stdio.h> #include <stdlib.h> #include <time.h> #define MAX_SIZE 100 #define MOD_NUMBER 100 #define COLUMN_WIDTH 10 //每行打印元素个数 int* getRandArray(int length, int min, int max); void showdata(int data[], int length); voi
2020-09-22 13:08:36 689
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人