728x90
binary
-
[ Linked-List ] 1290. Convert Binary Number in a Linked List to Integer - JAVA리트코드(Leetcode) 2023. 6. 7. 17:31
* leetcode의 1290번 문제를 풀어보도록 하겠다. 일단 linked-list란 뭔지 알아야 풀 수 있을 것 같다. * linked-list란? 배열인데 node라는 공간에 value와 해당 node와 연결된 이웃 node 자체 값을 갖고 있는 배열이다. 링크 리스트는 이런 식으로 한 node에 value와 다음 이웃노드의 주소값이 있는 형태로 되어 서로가 연결되어 있다. 1290의 문제를 읽어보자. 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 representatio..