Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
… into queue
  • Loading branch information
NeelavaChatterjee committed Dec 1, 2018
2 parents d62a1f9 + a72a2d1 commit b5ad3a4
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions queue/C/queue.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,22 @@ struct queue {

// Initialize the queue
void init(struct queue *st) {
st->front=0;
st->end=0;
st->front = 0;
st->end = 0;
}

// Method to check if the queue st is full or empty
void check(struct queue *st) {
if(st->front==0 && st->end==0)
if (st->front == 0 && st->end == 0)
printf("The queue is empty!!!!\n");
else if(st->end==10)
else if (st->end==10)
printf("The queue is full!!!!\n");
}

// Method to insert elements in the queue st
void enqueue(struct queue *st, int ele) {
check(st);
st->arr[(st->end)++]=ele;
st->arr[(st->end)++] = ele;
}

// Method to remove first element from the queue st
Expand All @@ -34,15 +34,15 @@ int dequeue(struct queue *st) {

// Method to show elements in the queue st
void show(struct queue st) {
for(int i=st.front; i<st.end; i++)
printf("%d",st.arr[i]);
for (int i = st.front; i < st.end; i++)
printf("%d", st.arr[i]);
}

// Driver method
void main(){
void main() {
struct queue st;
init(&st);
for(int i=1; i<9; i++)
for (int i = 1; i < 9; i++)
enqueue(&st, i);
show(st);
putchar('\n');
Expand Down

1 comment on commit b5ad3a4

@sangamcse
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on b5ad3a4.

There are 31 results for the section all.cpp. They have been shortened and will not be shown inline because they are more than 10.

Message File Line
Line contains following spacing inconsistencies: - Spaces used instead of tabs. queue/C/queue.c 5
Line contains following spacing inconsistencies: - Spaces used instead of tabs. queue/C/queue.c 6
Line contains following spacing inconsistencies: - Spaces used instead of tabs. queue/C/queue.c 11
Line contains following spacing inconsistencies: - Spaces used instead of tabs. queue/C/queue.c 12
Line contains following spacing inconsistencies: - Spaces used instead of tabs. queue/C/queue.c 17
Line contains following spacing inconsistencies: - Spaces used instead of tabs. queue/C/queue.c 18
Line contains following spacing inconsistencies: - Spaces used instead of tabs. queue/C/queue.c 19
Line contains following spacing inconsistencies: - Spaces used instead of tabs. queue/C/queue.c 20
Line contains following spacing inconsistencies: - Spaces used instead of tabs. queue/C/queue.c 25
Line contains following spacing inconsistencies: - Spaces used instead of tabs. queue/C/queue.c 26
Line contains following spacing inconsistencies: - Spaces used instead of tabs. queue/C/queue.c 31
Line contains following spacing inconsistencies: - Spaces used instead of tabs. queue/C/queue.c 32
Line contains following spacing inconsistencies: - Spaces used instead of tabs. queue/C/queue.c 37
Line contains following spacing inconsistencies: - Spaces used instead of tabs. queue/C/queue.c 38
Line contains following spacing inconsistencies: - Spaces used instead of tabs. queue/C/queue.c 43
Line contains following spacing inconsistencies: - Spaces used instead of tabs. queue/C/queue.c 44
Line contains following spacing inconsistencies: - Spaces used instead of tabs. queue/C/queue.c 45
Line contains following spacing inconsistencies: - Spaces used instead of tabs. queue/C/queue.c 46
Line contains following spacing inconsistencies: - Spaces used instead of tabs. queue/C/queue.c 47
Line contains following spacing inconsistencies: - Spaces used instead of tabs. queue/C/queue.c 48
Line contains following spacing inconsistencies: - Spaces used instead of tabs. queue/C/queue.c 49
Line contains following spacing inconsistencies: - Spaces used instead of tabs. queue/C/queue.c 50
Line contains following spacing inconsistencies: - Spaces used instead of tabs. queue/C/queue.c 51
Line contains following spacing inconsistencies: - Spaces used instead of tabs. queue/C/queue.c 52
Line contains following spacing inconsistencies: - Spaces used instead of tabs. queue/C/queue.c 53
Line contains following spacing inconsistencies: - Spaces used instead of tabs. queue/C/queue.c 54
Line contains following spacing inconsistencies: - Spaces used instead of tabs. queue/C/queue.c 55
Line contains following spacing inconsistencies: - Spaces used instead of tabs. queue/C/queue.c 56
Line contains following spacing inconsistencies: - Spaces used instead of tabs. queue/C/queue.c 57
Line contains following spacing inconsistencies: - Spaces used instead of tabs. queue/C/queue.c 58
Line contains following spacing inconsistencies: - Spaces used instead of tabs. queue/C/queue.c 60

Until GitMate provides an online UI to show a better overview, you can run coala locally for more details.

Please sign in to comment.