Algorithm 4 – Radix Sort, Suffix Sort

Coursera 에서 제공하는 Princeton 대학교의 Algorithm 수업인 Algorithm Part 1 의 4 번째 수업입니다. Strings in Java 문자열은 Character (문자) 의 나열이다. C 에서 하나의 캐릭터는 8-bit 인데, 자바의 경우에는 16-bit unsigned integer 로 표시한다. 스트링의 길이를 얻기 위해 length, 인덱싱 하기 위해 charAt, 서브스트링을 얻기 위해 substring 의 메소드를 지원한다. public final class String … Continue reading Algorithm 4 – Radix Sort, Suffix Sort

Algorithm 3 – Spanning Tree, Shortest Paths

Coursera 에서 제공하는 Princeton 대학교의 Algorithm 수업인 Algorithm Part 1 의 3 번째 수업입니다. Is a graph bipartite? 그래프가 bipartite 인가 하는 문제는, 그래프의 노드를 이렇게 두 그룹으로 나눌 수 있느냐 하는 문제다. (http://en.wikipedia.org) 알고리즘이 얼마나 어려운가는 이렇게 나눠볼 수 있겠는데 Any programmer could do it Typical diligen algorithms student could do it Hire an … Continue reading Algorithm 3 – Spanning Tree, Shortest Paths

Algorithm 2: Big O Analysis

Coursera 에서 제공하는 Princeton 대학교의 Algorithm 수업인 Algorithm Part 1 의 2 번째 수업입니다. 알고리즘을 분석해야 하는 이유는 (1) Predict performance (2) Compare algorithms (3) Provide guarantees (4) Understand theoretical basis 그 중에서도 performance bug 를 피하는 것이 무엇보다 중요하다. 이를 통해 내 알고리즘이 practical large input 에 적용할 수 있을까? 고민하는 것이, 알고리즘 분석의 … Continue reading Algorithm 2: Big O Analysis

Algorithm 1 – Union Find

Coursera 에서 제공하는 Princeton 대학교의 Algorithm 수업인 Algorithm Part 1 의 1 번째 수업입니다. Union Find Dynamic Connectivity N 개의 오브젝트가 있을때, Union command: connect two objects Find/connected query: is there a path connecting the two objects? 이렇게 두 경로가 연결되어있는지 아닌지를 판별하는 알고리즘은 다양하게 활용될 수 있다. Pixels in adigital photo Computers in a … Continue reading Algorithm 1 – Union Find