![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
leetCode
mulinhu
这个作者很懒,什么都没留下…
展开
-
leetCode--max-points-on-a-line
题目描述 对于给定的n个位于同一二维平面上的点,求最多能有多少个点位于同一直线上 Givennpoints on a 2D plane, find the maximum number of points that lie on the same straight line. 解题思路:主要是运用了三点共线原理。 先确定两个点可以构成一条线段,运用三点共线原理来判断第三个点...原创 2019-10-04 17:22:46 · 153 阅读 · 0 评论 -
leetCode--sort-list
题目描述 在O(n log n)的时间内使用常数级空间复杂度对链表进行排序。 Sort a linked list inO(nlogn) time using constant space complexity. 学习链表的文章 class ListNode { int val; ListNode next; ListNode(int x)...原创 2019-10-04 17:59:54 · 62 阅读 · 0 评论 -
leetCode--reorder-list
题目描述 将给定的单链表L:L0→L1→…→Ln-1→Ln, 重新排序为:L0→Ln→L1→Ln-1→L2→Ln-2→… 要求使用原地算法,并且不改变节点的值 例如: 对于给定的单链表{1,2,3,4},将其重新排序为{1,4,2,3}. Given a singly linked listL:L0→L1→…→Ln-1→Ln, reorde...原创 2019-10-06 12:39:40 · 98 阅读 · 0 评论 -
leetCode--linked-list-cycle
题目描述 判断给定的链表中是否有环 扩展: 你能给出不利用额外空间的解法么? Given a linked list, determine if it has a cycle in it. Follow up: Can you solve it without using extra space? 解题思路:利用快慢指针的性质,快慢指针相遇说明单链表中存在环 clas...原创 2019-10-06 12:44:40 · 119 阅读 · 0 评论 -
leetCode--linked-list-cycle-ii
题目描述 对于一个给定的链表,返回环的入口节点,如果没有环,返回null 拓展: 你能给出不利用额外空间的解法么? Given a linked list, return the node where the cycle begins. If there is no cycle, returnnull. Follow up: Can you solve it without us...原创 2019-10-06 12:54:28 · 118 阅读 · 0 评论