leetcode-141 環形鏈表(LinkedListCycle)-java

題目:環形鏈表算法 給定一個鏈表,判斷鏈表中是否有環。spa 進階: 你可否不使用額外空間解決此題?.net public boolean hasCycle(ListNode head) { if (head == null || head.next == null) return false; ListNode fast = head; ListNode
相關文章
相關標籤/搜索