Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- two pointers
- hash table
- greedy
- implement
- SQL
- java
- geometry
- 자바
- Math
- 코테
- Binary Search
- Stack
- sorting
- database
- array
- Counting
- Method
- Data Structure
- simulation
- Binary Tree
- bit manipulation
- string
- 구현
- dynamic programming
- Class
- Matrix
- Tree
- 코딩테스트
- Number Theory
- 파이썬
Archives
- Today
- Total
목록Reservoir Sampling (2)
코린이의 소소한 공부노트
[LeetCode/Medium] 398. Random Pick Index
목표: 배열에서 특정 수의 인덱스를 랜덤으로 반환해주는 클래스 구현 - 생성자 - pick() 1. Input - 생성자: int[] nums - pick(): int target 2. Output - pick(): nums에서 target의 인덱스 중 1개를 랜덤으로 반환 // 인덱스가 여러 개일 경우, 각 인덱스가 선택될 확률은 모두 같다. 3. Constraint 1) 1
코딩테스트 풀이/JAVA
2023. 2. 16. 23:18
[LeetCode/Easy] 382. Linked List Random Node
목표: 링크드 리스트의 노드값을 랜덤으로 돌려주는 Solution클래스 구현 - 생성자 - getRandom() 1. Input - 생성자: 링크드 리스트 - getRandom(): 없음 2. Output - getRandom(): 링크드 리스트의 노드값 중 하나 // 모든 노드들이 선택 받을 확률은 다 같아야 한다. 3. Constraint 1) 리스트에 포함된 노드의 수의 범위는 [1, 10^4]의 정수이다. 2) - 10^4
코딩테스트 풀이/JAVA
2023. 2. 14. 12:01