분류 전체보기
-
Linked List | Merge Two Sorted ListsAlgorithm/Linked List 2021. 5. 2. 17:11
Merge two sorted linked lists and return it as a sorted list. The list should be made by splicing together the nodes of the first two lists. 두 Linked List를 Merge하라는 문제이다. 두 리스트 모두 이미 순서대로 (작은숫자부터 큰숫자로) 정렬되어있다. 가장 단순한 방법은, 비교를 해가면서 새로운 리스트에 값을 복사하는 방법이 있을 것 같은데, 메모리를 조금 아끼려면, 주어진 Linked List자체를 변형하는 방법이 있다. class Solution { public ListNode mergeTwoLists(ListNode l1, ListNode l2) { ListNode tempHe..
-
Linked List | Reverse Linked ListAlgorithm/Linked List 2021. 4. 29. 23:27
Given the head of a singly linked list, reverse the list, and return the reversed list. 말 그대로, head노드를 가지고 Linked List를 reverse해서, 새로운 head를 리턴하는 문제다. 모두 오른쪽을 바라보다가, 순차적으로 왼쪽을 바라보게 하는 그림을 연상시킨다. 이 문제를 한큐만에, O(N)으로 푸는 방법이 있다. 바로 지나가면서 뒤집는 방법이다. 코드는 다음과 같다. class Solution { public ListNode reverseList(ListNode head) { ListNode newNext = null; ListNode temp = null; ListNode curr = head; while(curr ..
-
반도체 부족, 삼성 애플 그리고 자동차 업체까지 영향IT Daily 2021. 4. 29. 22:42
반도체 칩 부족현상이 심해지고있다. 여러 매체에서, 2021년 하반기 반도체칩 부족으로 2분기에는 여러 분야에서 생산에 차질이 생길것이라고 보도했다. 이는 우리가 사용하는 수많은 things들이 똑똑해지면서, 눈에보이는 컴퓨터 뿐만 아니라 자동차나 가전제품에도 embedded computer가 장착되고있기 때문이다. 그 뿐만 아니라 코로나의 영향으로 배송이 마비되기도 하고, 사람들이 집에 머무르면서 online learning, remote work, home-schooling등의 트렌드가 생긴것도 한몫을 했다. 이번에 발표한 신형 아이맥 모델과 아이패드 프로가 5월까지 배송이 안된다고 하는데, 이것은 전에 없던 이례적인 일이라고 한다. 어제 오늘, 전세계 유명한 IT 미디어에서는 칩 부족 현상을 주목했..
-
AWS Summit Korea and USIT Daily 2021. 4. 28. 23:07
2주 후, 5월 둘째주 월-수에 AWS Online Summit Korea가 시작된다. 그리고 목-금에는 US Summit이 진행된다! 한국과 미국의 최신 클라우드 컴퓨팅 기술들을 공유받을 수 있고, 또 Data Lake 설계와 ML(머신러닝)으로의 응용에 대한 스피치들이 잔뜩 준비되어있다. 회사에서 허락을 받고 1주일 참여를 하는데, 퀄리티 있는 세션들이었으면 좋겠다! 몇가지 기대되는것들이 많은데, 특히 한국 Summit에 자바의 아버님 James Gosling이 Keynote Speaker로 참여한다고 한다. 한국 Summit은 한국말로, 미국 Summit은 영어로 진행된다. 참가비는 무료이고 게다가 Raffle로 기프트카드를 받는 행사도 있다고 한다. 보통 첫째날에는 최신 AWS 인프라와 사용법에 ..
-
Linked List | Delete Node in a Linked ListAlgorithm/Linked List 2021. 4. 28. 22:52
Write a function to delete a node in a singly-linked list. You will not be given access to the head of the list, instead you will be given access to the node to be deleted directly. It is guaranteed that the node to be deleted is not a tail node in the list. Constraints: * The number of the nodes in the given list is in the range [2, 1000]. * -1000
-
Linked List | Middle of the Linked ListAlgorithm/Linked List 2021. 4. 27. 23:16
Given a non-empty, singly linked list with head node head, return a middle node of linked list. If there are two middle nodes, return the second middle node. LinkedList에서 가운데에 있는 Node를 리턴하라는 문제이다. 처음 접근은 1.5N의 loop을 돌리는 방식이었다. class Solution { public ListNode middleNode(ListNode head) { int count = 0; ListNode curr = head; while(curr != null){ curr = curr.next; count++; } curr = head; count = co..
-
디즈니와 로봇IT Daily 2021. 4. 27. 22:20
정말 좋아하는 디즈니 작품들의 캐릭터들이 실사 로봇으로 제작되어지고 있다. 디즈니의 이 Imagineering기술은 정말 오래됐다. 디즈니의 Imagineering Project, Kiwi라고 하는데, 특히 걸어다니고 눈을 마주치는 그루트, 정말 정말 귀엽다. 아래 유투브 비디오에 보면, 아바타 얼굴을 개발한것도 보이는데 소름끼칠정도로 현실같다. 너무나 좋아하는 미녀와야수 로봇을 도쿄 디즈니랜드에서 실사로 로봇 볼수있는 컵 놀이기구가 있다는데 한번쯤 가보고싶다. Reference 미라클레터 MIRAKLE page.stibee.com
-
Linked List | Convert Binary Number in a Linked List to IntegerAlgorithm/Linked List 2021. 4. 26. 23:41
Given head which is a reference node to a singly-linked list. The value of each node in the linked list is either 0 or 1. The linked list holds the binary representation of a number. Return the decimal value of the number in the linked list. Linked List에 binary 값이 들어가있고 (0 또는 1), 그 값을 integer값으로 계산하는 조건의 문제이다. 처음에는 O(N)이지만, 실제로는 2N, 그러니까 Loop을 두번 도는 알고리즘을 구현했다. Linked List에서는 Easy 난이도의 문제이다. cla..