摘要:
// language: c // 剑指30,已经通过,待发,目前博客园发文章的系统出问题了 // https://leetcode-cn.com/problems/bao-han-minhan-shu-de-zhan-lcof/ // 结点的结构体定义,每个节点记录值与当前最小值 typedef 阅读全文
摘要:
language: C address char* replaceSpace(char* s){ int num_space = 0; int getlen(char *st){ //由于还用于算 空格的数量,本函数只能被调用一次 int count = 0; while(st[count] != 阅读全文
摘要:
language: C address char* reverseWords(char* s){ int i,p,j; // 先算长度 int getlen(char *st){ int count = 0; while(st[count] != '\0') count++; return coun 阅读全文
摘要:
language: C address /** * Definition for a binary tree node. * struct TreeNode { * int val; * struct TreeNode *left; * struct TreeNode *right; * }; */ 阅读全文
摘要:
language: C 与主站34 基本一样 address // 先用二分法找到第一个,如果找不到,返回0个,找得到,再以此为起点左右计算数量 int search(int* nums, int numsSize, int target){ int low = 0,high = numsSize- 阅读全文
摘要:
language: C address // 憨憨题,不解释 /** * Definition for singly-linked list. * struct ListNode { * int val; * struct ListNode *next; * }; */ struct ListNod 阅读全文
摘要:
language: C address // 除就完了 int hammingWeight(uint32_t n) { uint32_t a =2; uint32_t yu; int ans = 0; for(int i = 0;i < 32; i++){ yu = n%a; if(yu ==1) 阅读全文
摘要:
language: C address // 很简单的递归 /** * Definition for a binary tree node. * struct TreeNode { * int val; * struct TreeNode *left; * struct TreeNode *righ 阅读全文
摘要:
language: C address // nt题,不解释 /** * Note: The returned array must be malloced, assume caller calls free(). */ int* printNumbers(int n, int* returnSiz 阅读全文
摘要:
language: C address // 考研做过,不解释 int majorityElement(int* nums, int numsSize){ int ans,count = 0; for(int i = 0; i < numsSize; i++){ if(count==0){ ans 阅读全文