Inventory
-
함수호출 최종정리@ 16. 1 ~ 17. 1/면접관련 2016. 12. 4. 17:47
스텍 세그먼트는 메모리..스택, 코드, 데이터, 힙 이런것..스택 프레임이란 함수가 호출 될 때마다 함수 호출을 위해 할당 받는 메모리 덩어리다. 스텍 프레임은 스택 세그먼트 안에 잡힌다. 스텍프레임을 사용해서 얻는 이점 : 복귀주소(여기서 복귀 주소는 함수 호출 직후의 주소, 즉 다음 주소를 이야기 한다) 전달이 가능해짐. (스택의 크기가 충분하다면), 함수의 인자전달, * 고정된 레지스터나 고정된 메모리 주소에 값을 쓰면 이전값이 사라지니까. 그리고 복귀 주소를 쌓아둔 메모리(스텍프레임이지..)중 가장 윗부분을 가리키는 레지스터가 SP이다. 함수내에서는 자동으로 함수가 종료되면 함수내에서 스택세그먼트의 주소를 4바이트 해제한다 그 이유는 스택 포인터 레지스터(4바이트)만큼 증가시켜둔걸 해제하기 위함이..
-
그래프 인접리스트(DFS, BFS)@ 16. 1 ~ 17. 1/면접관련 2016. 12. 4. 15:49
그래프를 인접 리스트로 구현하는 방법은 정점별 인접 정점을 연결리스트로 저장하는 방식이다.즉, 인접 리스트는 특정 노드에 연결되는 노드를 저장하는 방식을 통해 그래프를 구현한다. !! 이게 중요함..그리고 인접행렬과 틀린점은 메모리 낭비가 없다. 실제 연결된 노드만 리스트에 들어가니까..하지만 검색 시간은 더 걸린다.음..깊이우선은 현재 노드와 연결된게 우선이고..반면 넓이 우선은 현재 선택된 노드의 이전노드에서 연결된 다른노드들이 우선이다. 문제인 재귀호출 방법부터..DFS(node V)실제 처리 V v
-
렌더링 파이프라인 정리@ 16. 1 ~ 17. 1/면접관련 2016. 12. 4. 01:22
로컬변환-> 월드변환 -> 뷰변환 -> 후면추려내기 -> 조명 -> 테셀레이션 -> 클리핑 -> 투영 -> 뷰포트 -> 레스터 라이즈 ->텍스처 적용-> 렌더 백앤드 - > 출력 1. 로컬변환 : 모델하나의 고유한 좌표계 모델 좌표계라 하지..2. 월드변환 : 로컬 스페이스의 개체들을 월드좌표로 변환3. 뷰 변환 : 카메라를 좌표계의 원점으로 변환 -> 모든 개체들 변환여기서 말이다. 카메라가 원점으로 이동하고 이떄 물체도 같이 그만큼 이동하는거야. 그리고z축 양의 방향을 내려다보도록 방향을 변경하는데 이때 물체도 함께 회전을 한다. 4. 후면추려내기 : 두르기 순서의 시계 방향에 지정된 폴리곤을 전면 폴리곤으로 설정5. 조명 : 광원벡터, 시선 벡터, 법선 벡터 등 조명계산식을 이용해 정점의 색상계산6..
-
면접관련 정리@ 16. 1 ~ 17. 1/면접관련 2016. 12. 4. 01:05
빅 엔디안큰 주소부터 대입하는것리틀 엔디안작은 주소부터 대입하는것 빅 엔디안은 우리가 숫자쓰는거랑 같아.메모리 0x12345678 이라고 한다면메모리 주소 -> 0x100 0x101 0x102 0x1030x12 0x34 0x56 0x 78이런식이겠지.. 헷갈리지마 메모리의 주소에 쓰이는 메모리 값이 작냐 크냐인거야..저기 0x12345678이 크냐 작냐는거야0x12는 큰거다 대부분의 컴퓨터는 리틀 엔디언을 쓴다. 이건 인텔포멧이라 하지..거꾸로 네트워크에서는 빅 엔디언을 쓰다..헐.. 벡터란 방향과 크기만 있을뿐 위치는 없다. 벡터 내적 인라인 함수 : 변수에 직접 접근하는 것과 같은 효과를 제공하낟. 함수 호출로 인한 성능 문제를 해결...컴파일 시간 증가, 소스파일의 크기가 증가하게 된다;
-
면접대비 질문 정리@ 16. 1 ~ 17. 1/면접관련 2016. 12. 4. 00:25
절차지향과 객체지향 차이절차지향 : 순차적인처리 중요, C언어 컴퓨터의 작업 처리 방식과 유사 객체지향보다 더 빠름..객체지향 : 실제 세계를 모델링, 데이터와 절차를 하나의 덩어리로 묶어서 생각하는법.. 3대 특성으로는 캡슐화, 상속, 다형성캡슐화(데이터를 감추고 메소드로 통하는 방법), 상속(이미 작성된 클래스를 이어 받아 새로운 클래스를 생성하는것, 재활용성)다형성은(가상함수의 특성을 이용한것. 부모의 타입으로 자식의 함수를 실행) 절차지향의 특징은데이터와 함수가 분리되어 있다 (즉 독립적이다) 가상함수 테이블가상함수를 만들때 생기며 클래스의 첫 4바이트에 가상함수 테이블 주소가 추가된다. 인스턴스마다 존재하면 메모리 낭비가 심해서테이블을 클래스 정보로 두고 각각 인스턴는 포인터 값으로 가상함수 테..
-
이진검색 / 해싱해싱/ 균형이진탐색트리(열혈강의 책)@ 16. 1 ~ 17. 1/자료구조 2016. 12. 3. 01:01
이진검색을 보자..(이거 logn)미리 정렬된 자료를 대상으로 검색 범위를 반으로 감소시키는 과정을 반복하여 검색 키를 찾는다.여기서 이진은 검색을 반씩 줄이기 때문이다..이분검색이라는건...시작위치 + 마지막 위치 / 2 로 소수점은 버리고 정수만을 취한다. 재귀에 의한 구현int binarySearchRecursive(int value[], int start, int end, int key){int ret = 0;int middle = 0; if (start
-
면접전 최종 자료구조 정리..(게임프로그래를 위한 자료구조 책)@ 16. 1 ~ 17. 1/자료구조 2016. 12. 2. 02:39
정렬 알고리즘이 가져야할 최소한의 복잡도는 O(nlogn)만약 C++ new에서 동적배열의 크기를 -1로 하면 당연히 안만들어지지만...만약에 0으로하면 항복이 하나도 없는 배열을 가리키는유효한 포인터가 생성되어 나두면 메모리릭이 발생한다.배열 메모리 계층들 중 가장 낮은 곳에 위치한 것은 레지스터다. 컴퓨터 전체에서 가장 빠른 메모리이다. x86 기준 8개밖에 없다.그런데 다행히도 대부분의 프로세서들은 레지스터와 거의 비슷하게 빠르되 용량이 좀 더 큰 메모리 영역이 있다. 그것이 바로 캐시다.(보통 L1 캐시라고 한다)먼저 레지스터에서 자료를 찾고 없으면 L1캐시에서 찾고 또 없으면 다른 메모리 수준에서 찾는다..근데 이러면 시간이 오래 걸린다.그런데 메모리의 특징이 하나 더 있다. 메모리는 한 수준에..