摘要: 142.环形链表Ⅱ 题目 给定一个链表,返回链表开始入环的第一个节点。 从链表的头节点开始沿着 next 指针进入环的第一个节点为环的入口节点。如果链表无环,则返回 null。 为了表示给定链表中的环,我们使用整数 pos 来表示链表尾连接到链表中的位置(索引从 0 开始)。 如果 pos 是 -1 阅读全文
posted @ 2021-12-03 11:37 rananie 阅读(22) 评论(0) 推荐(0) 编辑
摘要: 统计文件的行数 题目 写一个 bash脚本以输出一个文本文件 nowcoder.txt中的行数 示例: 假设 nowcoder.txt 内容如下: #include <iostream> using namespace std; int main() { int a = 10; int b = 10 阅读全文
posted @ 2021-12-03 10:27 rananie 阅读(423) 评论(0) 推荐(0) 编辑
摘要: Shell 打印文件的最后5行 经常查看日志的时候,会从文件的末尾往前查看,于是请你写一个 bash脚本以输出一个文本文件 nowcoder.txt中的最后5行 示例: 假设 nowcoder.txt 内容如下: #include<iostream> using namespace std; int 阅读全文
posted @ 2021-12-03 10:26 rananie 阅读(416) 评论(0) 推荐(0) 编辑