본문 바로가기

ComputerScience

(48)
퀵정렬 최악의 경우가 아닌 Average Case로 Big O notation을 계산한다. 최악의 경우는 O(n^2) : 이미 정렬된 데이터가 들어온 경우 혹은 반대로 정렬된 경우 최선의 경우는 O(N*logN) : 매번 반으로 쪼개지는 경우! var test =Array.from({length: 6}, () => Math.floor(Math.random() * 39)+1); function quicksort(start,end){ if(start===end) { return; } var pointer=start; var pivot=test[end]; for(var j=start;j
Instructions 1. ISA ( Instruction Set Architecture) lowest sotfrware과 hardware의 interface 2. ABI ( Abstract Binary Interface) ABI는 OS와 ISA를 포함하는 개념이다. 3. MIPS ISA의 한 종류 byte addressable하며 word address는 4로 나누어질 수 있다. 4. Register와 Main memory Register 같은 경우 main memory보다 공간이 작기 때문에 빠르고 효율적으로 액세스 가능하다. MIPS architeuct의 경우, 32bit * 32bit Register를 사용한다. 또한 1word= 32bit= 4byte로 Register의 주소는 4로 나누어 떨어진다. 5. Data ..
XML xml은 마크업언어로서 복잡한 데이터를 표현하는데 유용하다. XML과 DBMS의 차이점 1. xml이 더 flexible 하다. 2. xml은 계층형 구조이다. 3. xml은 ordering이 있다. XML의 구성요소 1. Tagged Elements (nesting 가능) 2. Attributes : 한 개의 element가 여러 attribute을 가질 수 있다. 3. Text로 이루어져있다 XML structual requirements 1. root tag는 한 개만 존재해야된다. 2. Open Tag가 있으면 Closed Tag도 있어야된다. 3. 한 element 내에 중복된 attribute이 있으면 안된다. XML parser dom, sax XML content specificaition..
SQL 명령어 1. Data Definition Language 정의 : database나 database object create or delete DDL 종류 1. Create 2. Alter - db object의 structure를 바꾸기 때문에 DDL이라고 하는 것 같다 3. Drop 4. Truncate - table record 모두 삭제. table 자체를 삭제하는 것은 아니다. 5. Rename 2. DML Language 정의 : store, modify, delete records 종류 : update, delete, insert, select 3. SQL Operator - Arithmatic : +,-,%,/ 예시 select 20+30; - Comparison : =,>,
SQL 개요 1. SQL : Structured Query Langauge - 정의 : DataBase에 access하는 language - RDBMS를 조작하기 위한 Standar Query Language! -SQL 구성요소 1 a. data definition langauge : create, alter, drop, truncate - databsase 혹은 database object를 생성하거나 제거한다 b. data manipulation langauge : select, inser, update ,delete - database information(row)와 관련된 작업들 c. data control langauge : grant, revoke ,deny - database 의 administrator..
CPU Time and CPI 1. CPU 성능 CPU 성능의 지표로서 cpu time을 사용한다. cpu time = clock cycles for a program * clock cycle time = clock cycles/clock cycle rate 2. CPI ( Clocks per Instruction) cpu clock cycle= clocks per instruction * instruction counts cpu time = cpu clock cycle * clock cycle time = cpi * instruction counts * clock cycle time clock cycles = sum(cpi * instruction) average cpi = clocks cycles /instruction count..
컴퓨터구조 개요 1. 컴퓨터 성능 개요 a. 알고리즘의 성능 : 우리가 아는 빅오 notation을 의미한다 ( Operation의 수) b. Compiler 성능 : operation마다 필요한 instruction 수 c. Processor and memory system : instruction이 수행되는데 필요한 시간 d. Input Output 입출력 속도 2. 컴퓨터 구조 System Software는 크게 OS와 Compiler를 생각해볼 수 있다. OS는 리소스 관리를 해주고 Compiler는 High Level Langauge를 어셈블리어로 바꾸어 준다. 3. HLL -> Machine Langauge 순서 : HLL → compiler→ 어셈블리어 → assembler→ HW representation..
하노이 타워 1. 재귀함수적 사고 2. 탈출 조건 고려 #include #include char arr_start[5] = { '1', '2', '3' }; char arr_temp[5] = { '\0' }; //배열 0으로 초기화 char arr_end[5] = { '\0' }; int n = 3; void move(char arr1[], char arr2[]) { for (int i = n; i >0; i--) { arr2[i] = arr2[i - 1]; } arr2[0] = arr1[0]; for (int i = 0; i < n; i++) { arr1[i] = arr1[i + 1]; } } void visualize() { for (int i = 0; i < n; i++) { printf(" %c %c %c\n..