Insert into a Cyclic Sorted List

Insert into a Cyclic Sorted List 내가 푼 것 넘 조잡해요 ㅠ 변수를 더 안썼다는 것에 의미를 조금 부여하고, 생성자 활용해서 next 추가한 것을 베스트 답안을 참고해서 보완해야되겠다. -> 주어진 것 잘 활용하기.. /* // Definition for a Node. class Node { public: int val; Node* next; Node() {} Node(int _val) { val = _val; next = NULL; } Node(int _val, Node* _next) { val = _val; next = _next; } }; */ class Solution { public: Node* insert(Node* head, int insertVal) { if (!..
내공얌냠
'Insert into a Cyclic Sorted List' 태그의 글 목록