LeetCode
林尽处听雨眠
如果你眼睛看到的前方是热闹的,那这个方向不一定是好方向
人生最难的就是在热爱和生计之间做选择
愿每个人这一生
既对得起梦想又担得起生活的责任
这座城市没有一盏灯为你点亮,你只有燃耗自己才能照亮前进的道路。
展开
-
LeetCode每日一题~链表是否有环
LeetCode每日一题~链表是否有环141. Linked List CycleGiven head, the head of a linked list, determine if the linked list has a cycle in it.There is a cycle in a linked list if there is some node in the list that can be reached again by continuously following the ne原创 2022-04-26 10:29:20 · 681 阅读 · 0 评论 -
LeetCode每日一题之反转链表
LeetCode每日一题刷题记录。。206. Reverse Linked ListGiven the head of a singly linked list, reverse the list, and return the reversed list.题目大意链表反转解题思路1头插法反转在遍历链表时,将当前节点的 \textit{next}next 指针改为指向前一个节点。由于节点没有引用其前一个节点,因此必须事先存储其前一个节点。在更改引用之前,还需要存储后一个节点。最后返回新的头原创 2022-04-25 20:12:41 · 650 阅读 · 0 评论 -
LeetCode---剑指 Offer 20. 表示数值的字符串
题目描述请实现一个函数用来判断字符串是否表示数值(包括整数和小数)。例如,字符串"+100"、“5e2”、"-123"、“3.1416”、"-1E-16"、“0123"都表示数值,但"12e”、“1a3.14”、“1.2.3”、"±5"及"12e+5.4"都不是。原题解题思路本题使用有限状态自动机。根据字符类型和合法数值的特点,先定义状态,再画出状态转移图,最后编写代码即可。字符类型:空格 「 」、数字「 0—90—9 」 、正负号 「 ±+− 」 、小数点 「 … 」 、幂符号 「 eEeE原创 2020-09-02 17:56:26 · 82 阅读 · 0 评论