U E D R , A S I H C RSS

자료구족발보쌈/0715 (rev. 1.15)

자료구족발보쌈/0715

점점 탈주자가 생겨나고 있네요 역시 방학


1. 참여자 명단


함장 장용운 11학번 숙면
선원 천준현 15학번 행방불명
최지혁 출석
박인서 출석
이정재 고향
이원준 여행
조종현 늦잠 1 남헌 출석

2. 수업

2.1. 진행

1. 장소 : 6층 PC실
2. 시간 : 14시 20분~17시

2.2. 내용

수심 2000m. 큐
  • 스택 복습
  • 큐 만들기
  • 문제해결

3. 코드

3.1. 예제1


4. 숙제

0. 지금까지 한 내용 복습하기
1. 큐 복습하기




5. 숙제 제출

5.1. 천준현


5.2. 최지혁


5.3. 박인서



#include <stdio.h>
#include <stdlib.h>

typedef struct node{
	int val;
	struct node* next;
}node;

void push(node *, int);
int pop(node *);

int main()
{
	node head;
	head.next=NULL;
	push(&head,1);
	push(&head,2);
	push(&head,3);
	push(&head,4);
	printf("%d ",pop(&head));
	printf("%d ",pop(&head));
	printf("%d ",pop(&head));
	printf("%d ",pop(&head));
	return 0;
}

void push(node * target, int val)
{
	node * newnode=(node *)malloc(sizeof(node));
	node * temp=target->next;
	newnode->val=val;
	target->next=newnode;
	newnode->next=temp;
}
int pop(node * target)
{
	int res;
	node * kill=(node *)malloc(sizeof(node));
	if(target==NULL) abort();
	else if(target->next->next!=NULL) res=pop(target->next);
	else
	{
		res=target->next->val;
		kill=target->next;
		target->next=NULL;
		free(kill);
	}
	return res;
}

5.4. 이정재


5.5. 이원준


5.6. 조종현


Valid XHTML 1.0! Valid CSS! powered by MoniWiki
last modified 2021-02-07 05:30:37
Processing time 0.0303 sec