上一页 1 ··· 5 6 7 8 9 10 下一页
摘要: 伪目标的引入 默认情况下 make 认为目标对应着一个文件 make 比较目标文件和依赖文件的新旧关系,决定是否执行命令 make 以文件处理作为第一优先级 示例1 Code clean: rm *.o hello.out 执行:make clean ,删除所有以 .o 为结尾的文件和 hello. 阅读全文
posted @ 2020-06-27 11:20 nxgy 阅读(148) 评论(0) 推荐(0) 编辑
摘要: makefile 的意义 makefile 用于定义源文件间的依赖关系 makefile 说明如何编译各个源文件并生成可执行文件 依赖的定义 targets:prerequisites;command1 '\t' command2 makefile 中的元素含义 targets 通常是需要生成的目标 阅读全文
posted @ 2020-06-27 11:19 nxgy 阅读(112) 评论(0) 推荐(0) 编辑
摘要: make 是一个应用程序 解析源程序之间的依赖关系 根据依赖关系自动维护编译工作 执行宿主操作系统中的各种命令 makefile 是一个描述文件 定义一系列的规则来指定源文件编译的先后顺序 拥有特定的语法规则,支持函数定义和函数调用 能够直接集成操作系统中的各种命令 make 和 makefile 阅读全文
posted @ 2020-06-24 10:40 nxgy 阅读(105) 评论(0) 推荐(0) 编辑
摘要: 链接:https://leetcode-cn.com/problems/remove-duplicates-from-sorted-list/ 思路 因为输入的列表已排序,因此可以通过将当前结点的值与它之后的结点进行比较来确定它是否为重复结点。 如果它是重复的,更改当前结点的 next 指针,以便它 阅读全文
posted @ 2020-06-21 12:26 nxgy 阅读(105) 评论(0) 推荐(0) 编辑
摘要: 链接:https://leetcode-cn.com/problems/merge-two-sorted-lists/ 方法1:递归 思路 可以如下递归地定义两个链表里的 merge 操作(忽略边界情况,比如空链表等): \[ \left\{\begin{array}{ll} \text {list 阅读全文
posted @ 2020-06-21 12:01 nxgy 阅读(132) 评论(0) 推荐(0) 编辑
摘要: 链接:https://leetcode-cn.com/problems/remove-element/ 思路:与 26 题的解法十分相似 设置两个指针 \(fast\) 和 \(slow\),其中 \(slow\) 是慢指针,\(fast\) 是快指针 当 \(nums[fast]\) 与给定的值相 阅读全文
posted @ 2020-06-21 11:38 nxgy 阅读(117) 评论(0) 推荐(0) 编辑
摘要: 链接:https://leetcode-cn.com/problems/remove-duplicates-from-sorted-array/ 方法:双指针 思路 对于排序数组,设置两个指针 \(fast\) 和 \(slow\),其中 \(slow\) 是慢指针,\(fast\) 是快指针 当 阅读全文
posted @ 2020-06-21 11:36 nxgy 阅读(92) 评论(0) 推荐(0) 编辑
摘要: 2 两数相加——Medium 链接:https://leetcode-cn.com/problems/add-two-numbers/ 方法1:将长度较短的链表在末尾补零使得两个连表长度相等,再一个一个元素对其相加(考虑进位) 思路 获取两个链表所对应的长度 在较短的链表末尾补零 对齐相加考虑进位 阅读全文
posted @ 2020-06-15 19:31 nxgy 阅读(153) 评论(0) 推荐(0) 编辑
摘要: 1 两数之和——easy 链接:https://leetcode-cn.com/problems/two-sum/ 方法1:暴力遍历 思路 遍历每个元素 \(x\),并查找是否存在一个值与 \(target - x\) 相等的目标元素 时间复杂度:\(O(n^2)\) :对于每个元素,都试图通过遍历 阅读全文
posted @ 2020-06-15 19:01 nxgy 阅读(148) 评论(0) 推荐(0) 编辑
摘要: 题目链接:https://leetcode.com/problems/implement queue using stacks/ 可以用两个栈 inStack,outStack 来实现一个队列 inStack 用来接收每次压入的数据,因为需要得到先入先出的结果,所以需要通过一个额外栈 outStac 阅读全文
posted @ 2020-04-12 16:56 nxgy 阅读(85) 评论(0) 推荐(0) 编辑
上一页 1 ··· 5 6 7 8 9 10 下一页