본문 바로가기

분류 전체보기

(177)
[Java] 6-3강 - Collection Framework 3 (Set) 5. Set 0) Set [1] 원소간 중복을 허용하지 않는다. (no duplicate elements) [2] 원소간 순서가 없다. (no ordering of elements) 1> Hierarchy of interfaces 2> Interface Set에 정의된 Method (Interface Collection와 동일하다.) 1) HashSet 1> Method - Constructor load factor : (float의 형태) load factor를 넘어서면, capacity를 2배로 확장시킨다. 2> 다른 Method 3> AbstractCollection의 method - addAll, containsAll, retainAll, toArray(), toArray(T[] a), toStr..
[Java] 6-2강 - Collection Framework 2 (Iterator, Arrays, Comparable) 2. Iterator Collection에서 data를 읽어들이는 방법을 제공 1) Collection 내부 구조 iterator라는 메소드로 Collection을 Iterator로 만들 수 있습니다. 2) Method remove : 최근에 Iterator에서 return한 element를 제거 1> example 1 list는 List의 메소드만 사용이 가능합니다. 3) ListIterator 1> 특징 Iterator의 subclass (뒤로만 갈 수 있었던 Iterator와 달리) 앞뒤로 왔다갔다하는 것이 가능합니다. List interface를 implement한 class에만 사용 가능 2> Method 3. Arrays array와 관련된 기능들을 제공합니다. 1) array 관련 기능 1>..
[Java] 6-1강 - Collection Framework 1 (List - ArrayList, Vector, LinkedList, Stack & Queue) 1. List 0) List [1] 원소간 중복을 허용 (allows duplicate elements) [2] 순서가 있고 (ordered collection) 1> Hierarchy of interfaces 2> Interface List에 정의된 Method 1) ArrayList interface implement는 여러 개 할 수 있고 상속(extends)은 하나만 받을 수 있습니다. 0> Hierarchy of interfaces ※ ArrayList 소스코드 내부를 보면 Object array인 instance variable이 존재한다. 1> type variable로 primitive를 사용할 수 없습니다. (그래서 int대신에 Integer를 사용합니다.) -> (그래서 Integer의..
[Java] 6-0강 - Collection Framework 0. Collection 1) Hierarchy of interfaces Interface List & Interface Set은 Interface Collection의 subtype Interface Map은 별개의 interface입니다. 2) Interface Collection에 정의된 Method 1. List 0) List [1] 원소간 중복을 허용 (allows duplicate elements) [2] 순서가 있고 (ordered collection) 1> Hierarchy of interfaces 2> Interface List에 정의된 Method 2. Set 0) Set [1] 원소간 중복을 허용하지 않는다. (no duplicate elements) [2] 원소간 순서가 없다. (n..
[Java] 5-2강 - Generic Programming 2 (generic 기법 응용) 2. generic 내부의 type들을 자유롭게 응용 1) Limiting Types 특정 class만 generic class의 parameterized type으로 받게 하는 방법 1> 특정 class의 subclass만 받는 방법 2> 특정 interface를 implement한 class만 받는 방법 extend를 사용한다. (implement를 쓰지 않습니다.) 3> 1>과 2>를 동시에 쓰고 싶은 경우 2) Generic class의 상속 1> non-generic → generic 2> type parameter가 같으면, generic → generic 상속 가능 3> 부모 generic class는 자식 generic class의 type을 limit하는 것이 가능하다. 부모 generi..
6-4강 - Sequential Circuit Design 4 (Counter example) 6. Counter Example 0) Synchronous Counter 0> Example 2-bit Counter이며 x=1일 때에만, binary state가 00, 01, 10, 11로 변하고 x=0일 때에는 회로가 변하지 않는다. 1> State Diagram 2> State Table 3> JK Flip-Flop 관점으로 만든 State Table [1] JK Flip-Flop Exciation Table [2] JK Flip-Flop 관점으로 만든 State Table 4> Karnaugh Map 1) 2-bit Countdown Counter ※ 특이한 점 : output이 없다. state가 이미 binary number이다. 0> 문제 소개 x=0일 때는 변화가 없고 x=1일 때는 1..
6-3강 - Sequential Circuit Design 3 (Parity Checker example) 5. Parity Checker Example 0) Parity Checker 1> Parity Bit Parity Bit란 data를 송수신하는 과정 혹은 처리하는 과정에서 해당 data 내에 오류가 있는지를 검증하기 위해 사용하는 bit입니다. 보통 8bit 중에서 7bit는 data 정보를 담고 1bit를 Parity bit를 쓰는데 이 때, 7bit 내에 1의 개수가 짝수이냐 홀수이냐에 따라 Parity bit의 값이 다릅니다. 2> even parity checker data 내의 1의 개수를 짝수로 맞춰주어야 합니다. 그래서 7bit 내에 1의 개수가 홀수이면, Parity bit를 1로 설정 7bit 내에 1의 개수가 짝수이면, Parity bit를 0으로 설정 3> odd parity ch..
6-2강 - Sequential Circuit Design 2 (Sequence Detector example - Mealy & Moore) 4. Sequence Recognizer Example 1) Mealy Machine 0> example에 대한 소개 1101 sequence를 인식하는 sequence recognizer를 만듭니다. (주의 : 1101101은 1101이 2번 등장한 것입니다.) cf> Mealy Machine의 결정적인 특징 현재 state와 현재 input을 통해 다음 state를 결정합니다. 1. (state diagram) 그래서 arg(화살표)에 현재 input을 표기합니다. 2. (state table) 현재 input에 따라 output은 다르기 때문에 현재 input(x)에 따라 output을 따로 표기합니다. 1> State Diagram 만들기 (sequence 인식에 필요한 state들을 각각 정의합..