摘要:
66. 加一 - 力扣(LeetCode) 给定一个由 整数 组成的 非空 数组所表示的非负整数,在该数的基础上加一。 最高位数字存放在数组的首位, 数组中每个元素只存储单个数字。 你可以假设除了整数 0 之外,这个整数不会以零开头。 示例 1: 输入:digits = [1,2,3] 输出:[1, 阅读全文
posted @ 2023-09-15 12:23
C_Ryson
阅读(15)
评论(0)
推荐(0)
摘要:
目录 一:知识点 1,排序介绍 2,qsort 二,习题 1,912. 排序数组 - 力扣(LeetCode) (leetcode-cn.com) 2,169. 多数元素 - 力扣(LeetCode) (leetcode-cn.com) 3,217. 存在重复元素 - 力扣(LeetCode) (l 阅读全文
posted @ 2023-09-15 12:23
C_Ryson
阅读(30)
评论(0)
推荐(0)
摘要:
一:知识点 初阶的总结在前一篇文章已经写过,如果不太理解,可以去看看: 【万人千题】算法按位或12.3总结_C_Ryson的博客-CSDN博客 进阶的我们来讲一讲应用的方法。 在初阶中,我们讲到按位或可以处理一个数的某一位。那么这个特性也可以用在计数上,用这个位上的0,1来表示是否有存在。比如用在字 阅读全文
posted @ 2023-09-15 12:23
C_Ryson
阅读(9)
评论(0)
推荐(0)
摘要:
一:知识点 1,概念: 按位或(|),二元操作符,对两个整形数进行二进制位上的或运算 真值表如下: 左操作数右操作数值101111011000 总体来说就是:有一真即为真,两假才是假(C语言中默认0为假,非0为真)。 2,应用: 1.定位处理二进制位中的某一位 比如,现在有一个数1001001110 阅读全文
posted @ 2023-09-15 12:23
C_Ryson
阅读(53)
评论(0)
推荐(0)
摘要:
1,1295. 统计位数为偶数的数字 - 力扣(LeetCode) (leetcode-cn.com) int is(int n) { int bit=0; while(n) { n/=10; bit++; } return(bit%2==0); } int findNumbers(int* num 阅读全文
posted @ 2023-09-15 12:23
C_Ryson
阅读(8)
评论(0)
推荐(0)
摘要:
1,判断国际象棋棋盘中一个格子的颜色 1812. 判断国际象棋棋盘中一个格子的颜色 - 力扣(LeetCode) (leetcode-cn.com) bool squareIsWhite(char * coordinates) { int i=*(coordinates+1)-'0'; switch 阅读全文
posted @ 2023-09-15 12:23
C_Ryson
阅读(27)
评论(0)
推荐(0)
摘要:
一,知识点 1,指针定义 在数据在内存中的存放以字节为单位,为了正确使用这些数据,会把内存中每个字节编号,即为地址。 指针即为地址,可以定义一个指针变量来存放地址:(类型)*(指针变量名)。之后可以通过指针来直接访问变量从而实现改变变量的作用。 2,指针使用 定义完后可以对指针赋值。可以使用&(变量 阅读全文
posted @ 2023-09-15 11:19
C_Ryson
阅读(22)
评论(0)
推荐(0)
摘要:
目录 一,知识点 1,主知识点 2,补充知识点 二,习题 1,371. 两整数之和 - 力扣(LeetCode) (leetcode-cn.com) 2,面试题 08.05. 递归乘法 - 力扣(LeetCode) (leetcode-cn.com) 三,总结 一,知识点 1,主知识点 这是C语言打 阅读全文
posted @ 2023-09-15 11:19
C_Ryson
阅读(23)
评论(0)
推荐(0)
摘要:
1,1351. 统计有序矩阵中的负数 - 力扣(LeetCode) (leetcode-cn.com) int countNegatives(int** grid, int gridSize, int* gridColSize) { int row=gridSize; int col=gridCol 阅读全文
posted @ 2023-09-15 11:19
C_Ryson
阅读(39)
评论(0)
推荐(0)
摘要:
之前没做出来的题目又回去做了 目录 1,392. 判断子序列 - 力扣(LeetCode) (leetcode-cn.com) 2,240. 搜索二维矩阵 II - 力扣(LeetCode) (leetcode-cn.com) 3,2006. 差的绝对值为 K 的数对数目 - 力扣(LeetCode 阅读全文
posted @ 2023-09-15 11:19
C_Ryson
阅读(16)
评论(0)
推荐(0)

浙公网安备 33010602011771号