본문 바로가기

반응형

잡다한 IT

연결리스트를 통한 스택 구현 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899#include#include typedef struct Node { int data; Node* next;}Node; typedef struct stack { int count; Node* top;}stack; //연결리스트 스택 push 에서는 count를 생각하지 않아도 된다.void push(stack* st, int data){ Node* New = (Node*).. 더보기
링크드 리스트 구현 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816.. 더보기
배열을 이용한 스택 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687#include // STACK_MAX 값 설정#define STACK_MAX 100 // top 변수 선언int top;int stack[STACK_MAX]; // Init 함수로 top을 0으로 초기화void stackInit(void){ top = 0;} // top==0 이면 true 리턴, 아니면 false 리턴int stackIsEmpty(void){ return (top == 0);} // top==S.. 더보기
배열을 이용한 큐 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106#include //배열을 이용한 큐 만들기 // 큐의 MAX 값 설정#define MAX_N 100 // front, rear 설정int front;int rear;int queue[MAX_N]; // 큐를 초기화 -> front 와 rear 를 0으로 초기화.void queueInit(void){ front = 0; rear = 0.. 더보기
디바이스 드라이버와 디바이스 컨트롤러 차이 디바이스 드라이버는 소프트웨어, 디바이스 컨트롤러는 하드웨어 https://www.quora.com/What-is-the-difference-between-device-driver-and-device-controllers 더보기
polling 과 busy waiting 차이점 https://stackoverflow.com/questions/10594426/what-is-the-difference-between-busy-wait-and-polling 위에 출처 The difference between the two is what the application does between polls.If a program polls a device say every second, and does something else in the mean time if no data is available (including possibly just sleeping, leaving the CPU available for others), it's polling. If the program contin.. 더보기
임베디드 관련 공부 http://recipes.egloos.com/5207848 참고 더보기
TLB miss 와 Cache miss 차이점 https://stackoverflow.com/questions/16662834/is-cache-miss-a-kind-of-interrupt-fault 운영체제를 공부하던 중 TLB miss 와 Cache miss 차이가 뭔가 알아보다가 찾은 글. TLB miss는 exception이 발생하고, exception 핸들러가 OS에게 '소프트웨어적'으로 도움을 요청하는데이때 발생하는 오버헤드가 크다. 따라서 TLB 는 fully associative 를 사용하고TLB miss handling 을 가속화하기 위해서 HW page walker 를 이용한다. Cache miss는 반면에 set-associative 를 많이 쓴다. fully를 쓰면 비용이 너무 커지기 때문에.그렇다면 Cache miss 는 TLB.. 더보기

반응형