일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
- 주피터
- Hash Table
- Hash function
- virtualenvwrapper
- 우분투
- jupyter
- 다이나믹 프로그래밍
- django framework
- Euler
- Anaconda
- FNCP
- KTNF
- Python
- 파이썬
- ubuntu
- 파이썬3
- data structure
- 백준 알고리즘
- linked list
- 피보나치 수
- 프로젝트 오일러
- Django
- project euler
- Python3
- virtualenv
- Ipython
- 문자열
- IO Visor
- 아나콘다
- 국산 네트워크
- Today
- Total
목록Data Structure (4)
태코놀로지
1. Motivation- Use array (static set) or linked-list (dynamic set)- They take linear time for search operation (i.e., proportional to the size)- Need better method → hash table(Array/Linked-list의 크기에 비례하는 탐색시간을 줄이는 방법이 필요) 2. Problem- When a record to be inserted maps to an already occupied slot in hash table, a collision occurs- You need a good hash function(높은 확률로 테이블 크기가 데이터보다 작기 때문에 한 슬롯에 배정..
Simple means to resolve collision- "Chaining": Use linked-lists. New key inserted at the head of a list.(충돌난 hash slot에 linked-list를 이용해서 주렁주렁 이어 달자. 단 head!) Why not inserted at the tail?(왜 tail이 아니라, head?) tail에 달기 위해서, tail까지 탐색이 필요한데,search operation of linked-list takes linear time(i.e., proportional to the size)
What is the property of a good hash function?1. Even distribution- Minimizes "collision" of keys 2. Irregularness- Avoids collision of patterned inputs(E.g., input of {0, 100, 200, 300} for the hash function h(k) = k % 100)
Advantages1. Size varies dynamically (dynamic set)- Unlike the static array (static set) you don't need to reserve a large memory in advance2. Insertion, deletion, merging, splitting take only constant time (cf. takes linear time for search operation)- In contrast, array takes linear time (i.e., proportional to the size) for these operations Disadvantages1. You cannot access an element using an ..