- 博客(5)
- 资源 (1)
- 收藏
- 关注
原创 【力扣】剑指offerII 002.二进制加法
题目https://leetcode-cn.com/problems/JFETK5/class Solution { public String addBinary(String a, String b) { StringBuffer ans = new StringBuffer(); int la = a.length(); int lb = b.length(); int n = Math.max(la, lb);
2021-10-21 16:08:48 246
原创 【力扣】剑指offer II 001.整数除法
题目https://leetcode-cn.com/problems/xoh6Oh/class Solution { public int divide(int a, int b) { if(a == Integer.MIN_VALUE && b == -1) { return Integer.MAX_VALUE; } int sign = (a > 0) ^ (b > 0) ? -1 : 1;
2021-10-20 15:52:46 271 1
原创 【力扣】剑指offer II 003.前 n 个数字二进制中 1 的个数
题目:https://leetcode-cn.com/problems/w3tCBm/方法一:动态规划-最高有效位class Solution { public int[] countBits(int n) { int[] bits = new int[n + 1]; int highBits = 0; for (int i = 1; i <= n; i++) { if ((i & (i - 1)) ==
2021-10-20 15:05:47 152
原创 [CSAPP] [Lab 2] Bomb Lab
二进制炸弹这学期选修了计算机系统这门课,这门课的六个实验可以称作经典,特别是二进制炸弹这一实验,实验内容不断更新。简介 Binary Bombs A “binary bomb” is a Linux executable C program that consists of six “phases.” Each phase expects the student
2020-12-14 10:43:28 497
转载 char *s 和 char s[] 的区别
最近的项目中有不少c的程序,在与项目新成员的交流中发现,普遍对于char *s1 和 char s2[] 认识有误区(认为无区别),导致有时出现“难以理解”的错误。一时也不能说得很明白,网上也搜了一下相关文章发现一些写的比较好的,综合了一下当教育资料备用。 char *s1 = "hello";char s2[] = "hello"; 【区别所在】char *s1
2014-10-10 22:05:02 241
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人