328. Odd Even Linked List https://leetcode.com/problems/odd-even-linked-list/ Odd Even Linked List - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com Language: C++ time: O(n), space: O(1) /** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * Lis..
자료구조 알고리즘/코딩테스트
203. Remove Linked List Elements https://leetcode.com/problems/remove-linked-list-elements/ Remove Linked List Elements - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com Language: C++ class Solution { public: ListNode* removeElements(ListNode* head, int val) { if (head != NULL) { L..
206. Reverse Linked List Level: Easy https://leetcode.com/problems/reverse-linked-list/ Language: C++ /** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode() : val(0), next(nullptr) {} * ListNode(int x) : val(x), next(nullptr) {} * ListNode(int x, ListNode *next) : val(x), next(next) {} * }; */ class Solution { public: ListNode* reverseList(ListNode..
19. Remove Nth Node From End of List 난이도: Easy https://leetcode.com/problems/remove-nth-node-from-end-of-list/ Remove Nth Node From End of List - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com Language: C++ /** * Definition for singly-linked list. * struct ListNode { * int val; * ..
160. Intersection of Two Linked Lists https://leetcode.com/explore/learn/card/linked-list/214/two-pointer-technique/1215/ Explore - LeetCode LeetCode Explore is the best place for everyone to start practicing and learning on LeetCode. No matter if you are a beginner or a master, there are always new topics waiting for you to explore. leetcode.com Language: C++ class Solution { public: ListNode *..
142. Linked List Cycle II https://leetcode.com/problems/linked-list-cycle-ii/ Linked List Cycle II - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com Language: C++ /** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), n..
141. Linked List Cycle https://leetcode.com/explore/learn/card/linked-list/214/two-pointer-technique/1212/ Explore - LeetCode LeetCode Explore is the best place for everyone to start practicing and learning on LeetCode. No matter if you are a beginner or a master, there are always new topics waiting for you to explore. leetcode.com Language: C++ /** * Definition for singly-linked list. * struct ..
707. Design Linked List https://leetcode.com/problems/design-linked-list/ Design Linked List - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com Language: C++ https://leetcode.com/explore/learn/card/linked-list/209/singly-linked-list/1298/ // Definition for singly-linked list. struct..