We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0bd99fe commit 0d0395bCopy full SHA for 0d0395b
linked-list-cycle/mmyeon.ts
@@ -40,6 +40,9 @@ function hasCycle(head: ListNode | null): boolean {
40
* - 사이클이 있으면 두 포인터가 결국 같은 노드를 가리키게 되므로 투 포인터 사용
41
* - 사이클이 없는 경우를 위해서 tail노드의 null체크를 해야함
42
*
43
+ * 시간복잡도 : O(n)
44
+ * - 순환 이전 노드의 개수 n만큼 순회하면서 순환 여부 확인
45
+ *
46
* 공간복잡도 : O(1)
47
* - 추가 메모리없이 slow, fast 포인터만 사용하므로 O(1)
48
*/
0 commit comments