|
QueueInit(&q);
StackInit(&stack);
for(i=0;i<count;i++)
{
k = iarr[i];
Enqueue(&q,k);
}
while(!QIsEmpty(&q)){
fprintf(in,"%d\n",Dequeue(&q)); //큐에서받은정수를rand_list 파일에출력한다
}
for(i=0;i<count;i++) //마찬가지로위에서선언한배열이용하여스택에push한다
{
k = iarr[i];
SPu
|
- 페이지 10페이지
- 가격 2,000원
- 등록일 2015.03.13
- 파일종류 한글(hwp)
- 참고문헌 없음
- 최근 2주 판매 이력 없음
|
|
StackQueue.cpp
#include <stdio.h>
#include <stdlib.h>
#define TRUE 1
#define FALSE 0
typedef struct node {
short number;
struct node *next;
} node;
node *Init_Node();
node *Make_Node();
void Print_Node(node *);
short Input_Node(node *, short);
sho
|
- 페이지 13페이지
- 가격 1,000원
- 등록일 2012.11.13
- 파일종류 압축파일
- 참고문헌 없음
- 최근 2주 판매 이력 없음
|
|
struct{// Queue의구조체정의
listPointer qFront;
listPointer qRear;
} Queue;
void initQueue(Queue *Q);
boolean isEmpty(Queue* Q);
void addQueue(Queue *Q, element Data);
element deleteQueue(Queue *Q);
int getQueueLength(Queue *Q);
void printQueue(Queue *Q); 9주 - Stack & Queue using Link
|
- 페이지 5페이지
- 가격 1,500원
- 등록일 2010.05.28
- 파일종류 압축파일
- 참고문헌 있음
- 최근 2주 판매 이력 없음
|
|
스택을 완성시킨다.
2) Queue
① 크기가 4인 정수형 배열을 선언한다.(크기는 상관없음)
② 큐는 FIFO이기 때문에 값을 어떻게 넣어줘야할지 구상해야 한다.
③ Stack의 push() 함수를 Queue에서는 enqueue() 함수로 쓰이며, push() 함수와 마찬가지로 사용
|
- 페이지 5페이지
- 가격 2,000원
- 등록일 2009.04.10
- 파일종류 한글(hwp)
- 참고문헌 없음
- 최근 2주 판매 이력 없음
|
|
ntf("\n Queue is EMPTY... ");
getch();
return;
}
if(*sfront==*srear) // Stack이 비어 있는지 확인.
{
printf("\n Stack is EMPTY... ");
getch();
return;
}
printf("삭제되는 값 : Queue = %d , Stack = %d",queue[*front], stack[*srear-1]);
// 현재 삭제되는 값을 확인.
*front=++*front%10; // Queue의 마
|
- 페이지 5페이지
- 가격 1,500원
- 등록일 2009.11.28
- 파일종류 한글(hwp)
- 참고문헌 없음
- 최근 2주 판매 이력 없음
|