You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
아래의 Hash Table. put명령어를 보면
def(self, key:int, value: int) -> None:
---
---
---
#인덱스에 노드가 존재하는 경우 연결 리스트 처리
p = self.table[index]
while p:
if p.key == key:
p.value = value
return
if p.next is None:
break
이 부분이 이해가 안됩니다. 이 부분을 추가한 이유가 아래에서 error가 나게 하지 않기 위함으로 설명이 되있는데
이 코드가 있으면 연결 리스트를 만들 수 없지 않나요? 지금 ListNode를 보면 next의 default 값이 None으로 설정 되어 있어서 항상 위 구문이 실행돼 메서드를 탈출하게 되는데 위 구문이 있게 된 이유가 이해가 안됩니다.
좋은 책 써주셔서 감사합니다.
The text was updated successfully, but these errors were encountered:
안녕하세요. 해시테이블이 이해가 안돼 질문 드립니다.
아래의 Hash Table. put명령어를 보면
def(self, key:int, value: int) -> None:
---
---
---
#인덱스에 노드가 존재하는 경우 연결 리스트 처리
p = self.table[index]
while p:
if p.key == key:
p.value = value
return
이 부분이 이해가 안됩니다. 이 부분을 추가한 이유가 아래에서 error가 나게 하지 않기 위함으로 설명이 되있는데
이 코드가 있으면 연결 리스트를 만들 수 없지 않나요? 지금 ListNode를 보면 next의 default 값이 None으로 설정 되어 있어서 항상 위 구문이 실행돼 메서드를 탈출하게 되는데 위 구문이 있게 된 이유가 이해가 안됩니다.
좋은 책 써주셔서 감사합니다.
The text was updated successfully, but these errors were encountered: