전체 글 썸네일형 리스트형 연결리스트를 통한 스택 구현 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.. 더보기 2018-04-16 https://www.sangkon.com/2016/02/10/good_books_for_dev/ 프로그래머 필독서 50권 언젠가 하나씩 읽어봐야지 더보기 1799번 1799번 - 비숍 처음에는 N-Queen 처럼 행으로 접근했더니 시간 초과가 발생. 그 다음에는 대각선으로 생각했으나, 시간 초과 발생. 그리고 다른 사람들 힌트를 생각했더니, 홀수번째 대각선과 짝수번째 대각선은 서로에게 영향을 미치지 않는다. 그렇기 때문에 합으로 나타내서 시간을 줄일 수 있었다.( 예를들면 1억x1억을 1억+1억으로 바꾸면 시간이 확 줄듯이) 그렇게 해서 오른쪽 위로 올라가는 대각선을 짝수번째와 홀수번째로 나누었다. 처음 dfs문에서 x,y,c를 구하는 것은 각 대각선의 첫번째 값을 구하는 방법이다. 그리고 while문을 통해서 대각선의 값들을 하나씩 넣어보는 방식으로 문제를 풀었다. 이때 chk 배열은 대각선과 직각을 이루는 대각선이 사용됐는지 여부를 판단하는데 사용했다. 즉, 처.. 더보기 이전 1 ··· 14 15 16 17 18 19 20 ··· 61 다음