-
Notifications
You must be signed in to change notification settings - Fork 0
/
circular.c
40 lines (35 loc) · 949 Bytes
/
circular.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
//circular liked list
//important points abt cll
//i)cll is type of link list comprises of data and link fields where in last node address is pointing to first node
//ii)transversing is easier
//iii)there is no null field in the list
//iv)improper programming leads to infinite loop
//v)cll is use to implement data structure like satck queue and heap
//vi)implementation of round robin scheduling
#include<stdlib.h>
#include<stdio.h>
//to create node
struct node
{
int info;
struct node *link;
};
void display(struct node *tail)
{
struct node *tmp=tail->next;
//one pointer points to last node while the other traverse
//through entire list
do
{
printf("%d\n",p->info);
tmp=tmp->next;
} while (tmp!=tail->next);
}
int main()
{
int data=34;
struct node *tail;
tail=circularsingly(data);
printf("%d\n",tail->info );
return 0;
}