<commit_before>#include <stdio.h>
#include <stdlib.h>
#define MAXSIZE 100

typedef struct Queue {
	int head;
	int tail;
	int array[MAXSIZE];
} Queue;

Queue *initQueue();
void push(int);
int pop();
int front();
int empty();

Queue *qu;
main()
{
	qu = initQueue();
	push(1);
	push(2);
	push(3);
	printf("%d\n", pop());
	printf("%d\n", front());
	return 0;
}

Queue *initQueue()
{
	Queue *q = (Queue *)malloc(sizeof(Queue));
	q->head = 0;
	q->tail = 0;
	return q;
}

void push(int data)
{
	if (qu->head <= qu->tail && qu->tail < MAXSIZE)
		(qu->array)[(qu->tail)++] = data;
}

int pop()
{
	if (qu->head <= qu->tail && qu->tail < MAXSIZE)
		return (qu->array)[(qu->head)++];
	qu->head = 0;
	qu->tail = -1;
	return -1;
}

int front()
{
	if (qu->head <= qu->tail && qu->tail < MAXSIZE)
		return (qu->array)[qu->head];
	return -1;	
}

int empty()
{
	return (qu->head >= qu->tail && qu->head != 0) ? 1 : 0;
}<commit_msg>question4.2 edited<commit_after>#include <stdio.h>
#include <stdlib.h>
#define MAXSIZE 100

/*ͼнڵ㣬Է֮Ƿ·
*ʹöд洢ڵ㣬ͨbfsвңĿǰ
ûкð취ʾͼ*/
 
typedef struct Queue {
	int head;
	int tail;
	int array[MAXSIZE];
} Queue;

Queue *initQueue();
void push(int);
int pop();
int front();
int empty();

Queue *qu;
main()
{
	qu = initQueue();
	push(1);
	push(2);
	push(3);
	printf("%d\n", pop());
	printf("%d\n", front());
	return 0;
}

Queue *initQueue()
{
	Queue *q = (Queue *)malloc(sizeof(Queue));
	q->head = 0;
	q->tail = 0;
	return q;
}

void push(int data)
{
	if (qu->head <= qu->tail && qu->tail < MAXSIZE)
		(qu->array)[(qu->tail)++] = data;
}

int pop()
{
	if (qu->head <= qu->tail && qu->tail < MAXSIZE)
		return (qu->array)[(qu->head)++];
	qu->head = 0;
	qu->tail = -1;
	return -1;
}

int front()
{
	if (qu->head <= qu->tail && qu->tail < MAXSIZE)
		return (qu->array)[qu->head];
	return -1;	
}

int empty()
{
	return (qu->head >= qu->tail && qu->head != 0) ? 1 : 0;
}
{'fraction_non_alphanumeric': 0.2413055109684323, 'fraction_numerical': 0.01819154628143392, 'mean_word_length': 3.605911330049261, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 53, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4754767', 'n_tokens_mistral': 862, 'n_tokens_neox': 825, 'n_words': 200}