Professional Documents
Culture Documents
Computer Science & Engineering: Department OF
Computer Science & Engineering: Department OF
Experiment - 1.3
Student Name: Anuj Anand UID: 22BCS80050
Branch: General CSE Section/Group: 607 - B
Semester: 5th Date of Performance: 21/08/2023
Subject Name: Advance Programming Subject Code:21CSP-314
1. Aim
Demonstrate the concept of Linked Lists.
CODE :
OUTPUT
CODE
OUTPUT
CODE
if (temp->next != NULL)
{
DoublyLinkedListNode *next = temp->next;
next->prev = New; New->next = next;
}
else
New->next = NULL; temp-
}
return head;
}
OUTPUT
COMPLEXITY:
• For insertion in the linked list, the time complexity is O(1) if done on the head,
O(N) if done at any other location, as we need to reach that location by traversing
the linked list.
• For deletion, the time complexity is O(1), if done on the head, O(N), if done at
any other location, as we need to reach that location by traversing the linked list.
• For searching and accessing any elements, the involved time complexity is O(N)