728x90
반응형
Middle of the Linked List
-
[Leet Code] Two Pointers (투포인터): 876.Middle of the Linked List - EasyCS기초/Algorithm, Data Structures 2023. 1. 2. 02:04
문제 / 코드 드디어 linked list가 나왔다. 링크드리스트 자료구조 포스팅이랑 같이 올리려고 했는데 시간이 너무 늦어 다음 코드리뷰 포스팅이랑 같이 올려야겠다 (어차피 앞으로 링크드리스트 주구장창 나올 예정이기 때문에..) Description Return middle node of the linked list. If there are two middle nodes, return the second middle node. How to solve Simple way Iterate the linked list from the first node to get the full length. Iterate the linked list from the first node again, change the cu..