-
[30일코딩] Binary Numbers 2진법개발입문/JAVA 2017. 5. 6. 18:15
Base 2, 2진법의 세계 컴퓨터의 세계는 0과 1, - Booleans : True or False - ON / OFF Switch- 1 bit 사람은 Base 10 10진법, 달력은 12진법을 사용합니다.용도에 따라 10진법 수을 2진법으로, 12진법으로 자유자재로 변경할 수 있어야 합니다~- Binary to Decimal Conversion- Decimal to Binary Conversion Base 진법의 원리 A * B^DA: 0 ~ Base -1B: BaseD: Numerical Digit Location e.g. 723 = 7 * 10^2 + 2 * 10^1 + 3 * 10^0 2진법 유사코드 while(n > 0): remainder = n%2; n = n/2; Insert remai..
-
[30일코딩] Recursion개발입문/JAVA 2017. 5. 6. 17:53
재귀, 귀납, 반복 RecursionThe process of defining a function or calculating a numberby the repeated application of algorithm. Same function within the function- 함수 안에 함수 호출- f(f(f(x))) - 러시아 인형처럼; 사용법- Base Case & Recursive Case- Same function within the function public static int Summation(int x) { // Base Case : At the Endif (x
-
[30일코딩] 딕셔너리 Dictionary개발입문/JAVA 2017. 5. 6. 16:59
Dictionary 1. insert2. find3. delete 특징 - key-value pairs- no-guaranteed order (except Treepmap)- .size- boolean? Boolean!Reference type 사용! primitive type 사용불가! 생성 Map engSpanishDic = new HashMap- Map Interface- concrete class HashMap Map shoppingList = new HashMapshoppingList.put("Ham", true);shoppingList.put("Icecream", Boolean.FALSE); 사용 // Create a Map of String Keys to String Values, imple..
-
[30일코딩] 배열개발입문/JAVA 2017. 5. 6. 15:21
Data Structure - 데이터를 효율적으로 저장, 조회, 사용할 수 있는 방법그 중에서 가장 간단한(?) Arrays 배열을 공부했습니다. Arrays 배열 A container object that hold fixed numbers of valuethat have a single datatype 하나의 데이터타입을 넣을 수 있는고정된 크기의 컨테이너 객체 index / slotlength 5 (0~4 inclusive) 선언, (space) 할당, 초기화Declaring, Allocating, Initializing int[] intArray1;int[] intArray2 = new int[4];int[] intArray3 = {5, 2, 9, 1}; 값 조회, 변경System.out.print..
-
[30일코딩] 반복문개발입문/JAVA 2017. 5. 5. 13:23
WHILE / DO WHILE This type of loop requires a single boolean condition and continues looping as long as that condition continues to be trueTrue or False 조건문을 만족할때까지 루프 반복을 계속한다. WHILE 은 조건에 맞는지 전에 확인하고 루프반복을 처리한다면,DO WHILE 은 루프반복을 처리하고, 그 후에 조건이 맞는지 확인한다.그래서 첫번째 루프는 꼭꼭꼭 실행된다! FOR초기화 조건과 종료조건 사이만큼 루프 반복을 계속한다. NESTED FORFor 안의 For (Outer For Loop, Inner For Loop) 행렬에 이용 FOR LOOP for (initializati..
-
[30일코딩] 클래스와 인스턴스개발입문/JAVA 2017. 5. 5. 11:18
클래스 클래스 변수/메소드 same static variable인스턴스를 만들지 않아도 클래스 공통으로 사용할 수 있는 변수/메소드e.g. Car 의 minSpeed 는 모든 차 불문하고 0 인스턴스 변수/메소드 distinct value of each instance각 인스턴스가 다르게 가질 수 있는 변수/메소드e.g. Car 의 maxSpeed 는 차종마다 다르다. 스포츠카는 200 일반차는 150 생성자 Overloaded Constructor- allows multiple constructor - Default Constructor- Parameterized Constructor 메소드Scope of this function to access itGenericReturn typeParameter ..
-
[30일코딩] 조건문 Conditional Statement개발입문/JAVA 2017. 5. 5. 10:52
조건에 따라 복잡한 처리를 하게끔 해주는 조건문 1. TRUE or FALSE 조건문은 논리이다.컴퓨터의 최소단위 bit 는 1 or 0 만 인식하고우리는 이것을 true or false 이분법적으로 인식한다. Boolean 불린 True or False 2. 논리 연산자여러 조건을 따지려면 OR, AND, NOT 논리연산자를 사용한다. || OR Operator, logical disjunction&& AND Operator, logical conjuction! NOT Operator, negation? : ternary Operator 3. 조건문 문법조건에 대한 처리에 따라서 3개가 있다.대뜸 조건문이라고 IF/ELSE 만 사용하지 말고!어떤게 맞는 상황인지 FLOW 를 그려보고, 결정하자. 1) ..