일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- X윈도우
- Physical Scheme
- Polymolphism
- 리눅스 마스터 1급
- Binary Search
- BFS
- Mac
- Unity
- Entity
- OOP
- Reference Type
- 리눅스 기초
- Operator
- literal
- 셀레니움
- Entity Set
- X.org
- Inheritance
- 자바
- selenium
- Class
- 리눅스
- zsh
- systemd
- External Scheme
- Java
- preprocessing
- dbms
- python
- 백준
- Today
- Total
목록2024/07/06 (3)
Byeol Lo
이진트리로 자식 노드가 최대 2개 있을 수 있는 트리이면서, 왼쪽에는 부모보다 작은 값이, 오른쪽에는 부모보다 큰 값이 오게 된다. 다른 함수들에서 유용하게 쓰일 search를 먼저 선언했다.public TreeNode search(T node) { TreeNode cur = parent; while (cur.value != null) { if (cur.value.compareTo(node) == 0) return cur; if (cur.value.compareTo(node) Add생성할 때는, nil 일 때까지 반복을 하고, nil 일 때까지 반복시켜서 nil에 값을 넣으면 된다.@Overridepublic void add(T node) { ..
처음에 이해하는데 꽤나 애먹었지만, 막상 이해하고 나니 별거 없는 알고리즘이었다. 간단하게 구현할 수 있고, 빠른 문자열 검색 알고리즘으로 O(n+m)의 시간이 걸리는 알고리즘이다. 핵심 원리는 '상호배타적인' prefix와 postfix를 이용하는 것이다. 이를 어떻게 이용해서 linear 한 시간을 달성할 것인지 의문일 수 있는데, prefix라는 것은 문자열의 시작부분부터 어느 지점까지를 말하고, postfix라는 것은 문자열의 어떤 지점부터 마지막 부분 까지이다.찾고싶은 문자열(Prefix + Postfix)이 아래, 그리고 검색 될 문자열들이 위에 있다고 하자. 만약에 찾고 싶은 문자열이 abab라고 해보자. 검색 될 문자열 text가 abcccaab라고 해보자. abab와 abcccaab에 ..
세마포어가 프로세스 동기화를 위한 편리하고 효과적인 메커니즘을 제공하지만, 이를 잘못 사용하면 특정 실행 순서에서만 발생하는 타이밍 오류로 인해 감지하기 어려운 문제가 생길 수 있다(프로그래머가 잘못 짤 경우임). 이러한 오류는 항상 발생하는 것이 아니기 때문에 더욱 발견하기 어렵다. 생산자-소비자 문제의 해결책에서 카운트를 사용하는 예를 통해 이러한 오류를 본 적이 있을 것이다(컴파일러의 최적화 때문에 재배열 때문), 이 Mutex Lock이나 Semaphore 마저도 사용할 때도 여전히 타이밍 오류가 발생할 수 있다... 모든 프로세스는 1로 초기화된 binary semaphore 가 가지는 변수인 mutex를 공유하며, critical section에 진입하기 전에 wait(mutex)를 실행해야 ..