Skip to content
Open
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
9 changes: 4 additions & 5 deletions circularListinsertion
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,16 @@ struct Node *addToEmpty(struct Node *last, int data)
{
// This function is only for empty list
if (last != NULL)
return last;
return last;

// Creating a node dynamically.
struct Node *temp =
(struct Node*)malloc(sizeof(struct Node));
struct Node *temp = (struct Node*)malloc(sizeof(struct Node));

// Assigning the data.
temp -> data = data;
last = temp;
// Note : list was empty. We link single node
// to itself.

// Note : list was empty. We link single node to itself.
temp -> next = last;

return last;
Expand Down