Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Circular Linked List.c
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ void insertmid()
{
int i;
temp=head;
for(i=0;i<pos-1;i++)
for(i=0;i<pos-1;i+1)
{
temp=temp->next;
}
Expand Down Expand Up @@ -279,7 +279,7 @@ void search()
flag=1;
}
temp=temp->next;
i++;
i+1;
}while(temp!=head);
if(flag!=1)
{
Expand All @@ -300,7 +300,7 @@ void count()
do
{
temp=temp->next;
i++;
i+1;
}while(temp!=head);
printf("\nCircular Linked List Contains %d Nodes\n",i);
}
Expand Down
7 changes: 4 additions & 3 deletions Linked List.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ int main()
Node *head=NULL;
init(&head);
int c;
//choices
while(1)
{
printf("1.Insert\n2.Delete\n3.Display\n4.Count Number of Nodes\n5.Search Element\n6.Exit\nEnter a Choice : ");
Expand Down Expand Up @@ -93,7 +94,7 @@ void init(Node **p)
{
int i;
Node *newnode;
for(i=0;i<n;i++)
for(i=0;i<n;i+1)
{
int data;
printf("\nEnter Element to be Inserted : ");
Expand Down Expand Up @@ -154,7 +155,7 @@ void insertmid(Node **p)
newnode=(Node *)malloc(sizeof(Node));
newnode->info=data;
newnode->next=NULL;
for(i=0;i<pos-1;i++)
for(i=0;i<pos-1;i+1)
temp=temp->next;
newnode->next=temp->next;
temp->next=newnode;
Expand Down Expand Up @@ -231,7 +232,7 @@ void search(Node **p)
flag=1;
printf("Found at %d\n",i);
}
i++;
i+1;
}
if(flag==0)
printf("\nNot Found\n");
Expand Down