목록더블링크리스트 (2)
어흥
문제 링크: www.hackerrank.com/challenges/insert-a-node-into-a-sorted-doubly-linked-list/problem Inserting a Node Into a Sorted Doubly Linked List | HackerRank Create a node with a given value and insert it into a sorted doubly-linked list www.hackerrank.com 1. 주의할 점 - List의 가장 앞 혹은 뒤에 추가되는 경우를 조심한다 2. 구현 - 2가지의 방법을 통해 구현해봤다 [List 생성] - DoublyLinkedList* list라는 새로운 리스트를 생성한다 - 추가되었는지의 여부를 Add 변수를 통해 ..
문제 링크: www.hackerrank.com/challenges/reverse-a-doubly-linked-list/problem Reverse a doubly linked list | HackerRank Given the head node of a doubly linked list, reverse it. www.hackerrank.com 1. 주의할 점 - Node나 NodeList를 이용하여 해결한다 - 현재 문제에선 전부 구현되어있지만, 직접 함수나 구조체를 구현하는 연습을 기른다 2. 구현 - 리버스된 Node를 담는 DoublyLinkedList를 생성한다 - Reverse 함수의 파라미터로 받는 변수가 DoublyLinkedList의 Head를 받았으므로 기존 List의 Tail을 향하도록 ..