diff --git a/data_structures/queue.c b/data_structures/queue.c index 231faf7e..b8f600ca 100644 --- a/data_structures/queue.c +++ b/data_structures/queue.c @@ -52,14 +52,14 @@ void enque(int x) { if (head == NULL) { - head = (struct node *)malloc(1 * sizeof(struct node)); + head = (struct node *)malloc(sizeof(struct node)); head->data = x; head->pre = NULL; tail = head; } else { - tmp = (struct node *)malloc(1 * sizeof(struct node)); + tmp = (struct node *)malloc(sizeof(struct node)); tmp->data = x; tmp->next = tail; tail = tmp; @@ -92,4 +92,4 @@ int deque() /** * Returns the size of the Queue. */ -int size() { return count; } \ No newline at end of file +int size() { return count; }