摘要: /** * * 判断一个链表是否有环 【141】 * * * 快慢指针,求相遇 */ var hasCycle = function(head) { if(!head) return false let pre = head, cur = head; while(cur && cur.next) { 阅读全文
posted @ 2021-07-21 11:32 南望先生 阅读(146) 评论(0) 推荐(0) 编辑