链接:https://leetcode-cn.com/problems/add-two-numbers/ 代码: /** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * L ...
分类:
其他好文 时间:
2020-05-25 00:15:00
阅读次数:
65
一、熟悉对应的系统调用 本人学号尾号86,对应的系统调用号是link,在./arch/x86/entry/syscall_64.tbl得到如下信息: # # 64-bit system call numbers and entry vectors # # The format is: # <numb ...
分类:
其他好文 时间:
2020-05-24 00:17:18
阅读次数:
56
A message containing letters from A-Z is being encoded to numbers using the following mapping: 'A' -> 1 'B' -> 2 ... 'Z' -> 26 Given a non-empty strin ...
分类:
其他好文 时间:
2020-05-23 09:55:43
阅读次数:
57
题目: 思路: 关于旋转数组有各种变种问题:是否有重复元素、寻找最大值最小值、寻找旋转点下标(旋转点的值等于最小值)、查找给定元素。本题就是对有重复元素的旋转数组,寻找其最小值。 首先想到二分查找没问题,关键在于怎么通过判断middle元素的相对大小去逐渐缩小搜索区间。如下图所示(无重复元素) 循环 ...
分类:
编程语言 时间:
2020-05-22 14:22:49
阅读次数:
45
/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; */ class Solu ...
分类:
其他好文 时间:
2020-05-20 12:40:43
阅读次数:
58
1.启动go module set GO111MODULE=on GO111MODULE=off 禁用模块支持,编译时会从GOPATH和vendor文件夹中查找包 GO111MODULE=on启用模块支持,编译时会忽略GOPATH和vendor文件夹,只根据 go.mod下载依赖 GO111MODU ...
分类:
其他好文 时间:
2020-05-19 14:38:46
阅读次数:
60
这道题没有想法。。。。 解法一:暴力解法 public int rangeBitwiseAnd(int m, int n) { int res = m; for (int i = m + 1; i <= n; i++) { res &= i; } return res; } 作者:windliang ...
分类:
其他好文 时间:
2020-05-19 00:22:55
阅读次数:
60
"传送门传送传送值啊都数时" $首先,构造千万不要想复杂了,尽量往简单的想$ $我们构造的a[i]应该互不相同最好,因为相同不好选择$ $比其中一个大就比很多个大,不好确定排名$ $\color{Red}{既然如此,我就规定最终a[i]取[1,n]}$ $这样一来根就被唯一确定是,a[root]=c ...
分类:
其他好文 时间:
2020-05-17 17:59:15
阅读次数:
69
给你两个 非空 链表来代表两个非负整数。数字最高位位于链表开始位置。它们的每个节点只存储一位数字。将这两数相加会返回一个新的链表。 你可以假设除了数字 0 之外,这两个数字都不会以零开头。 进阶: 如果输入链表不能修改该如何处理?换句话说,你不能对列表中的节点进行翻转。 来源:力扣(LeetCode ...
分类:
其他好文 时间:
2020-05-17 01:15:54
阅读次数:
66
People on Mars count their numbers with base 13: Zero on Earth is called "tret" on Mars. The numbers 1 to 12 on Earth is called "jan, feb, mar, apr, m ...
分类:
其他好文 时间:
2020-05-16 15:09:08
阅读次数:
63