Insertion and Deletion in Linked List in Hindi
?????????????????? ??????????????? ?????? ?????? ?????? ??????????????? ????????????????????? ?????? ????????? ?????????, ?????????????????? ?????? ?????????????????? (Node) ??????????????? ?????? ???????????? ?????????????????? ?????? ??????????????? ???????????? ????????? ?????? ?????? ???????????? ????????? ????????? ?????????????????? ?????????????????? ?????? ?????? ???????????? ?????????????????? ?????? ??????????????? ??????, ?????? ???????????? ??????????????? ?????? ???????????? ???????????????, ?????? ???????????? ?????? ?????????????????? ???????????? ???????????? ????????? ????????? ?????? ???????????? ?????? Linked List ???????????? ??????????????????????????? ?????????, ???????????? ??????????????? (?????????????????? ???????????? ?????? ???????????? ????????? ?????? ????????? ???????????? ??????) ?????? ??????????????? ?????? ??????????????? ?????? ???????????? ????????? ?????? ??????????????? ????????? ?????? ???????????? Linked List ????????? Insertion ?????? Deletion (Insertion and Deletion in Linked List in Hindi) ?????? ??????????????????????????? ?????? ???????????? ???????????? ????????? ????????????????????????, ??????????????? ????????? ??????????????? ????????????, ?????? C ???????????????????????? ?????? ????????? ?????? ????????????
What is Linked List in Hindi - ?????????????????? ??????????????? ???????????? ???????????? ???????
Linked List ?????? ???????????????????????? ???????????? ??????????????????????????? ??????, ?????????????????? ??????????????? (Nodes) ?????? ?????? ???????????????????????? ???????????? ????????? ?????? ????????? ?????? ??????????????? ????????? ???????????? ???????????? ??????:
- ????????????: ?????? ???????????? ????????????????????? ???????????? ?????? ??????????????? ???????????? ??????????????? ????????? (???????????? ????????? ????????????, ?????????, ?????? ???????????????)???
- ??????????????????: ?????? ???????????? ????????? ?????? ????????? ???????????? ??????, ???????????? ?????? ?????? ???????????? ???????????? ?????? ?????? ??????????????? ?????? ?????????????????? ?????????
??????????????????: ????????? ??????????????? ?????? ???????????? ??????????????? ??????????????? ?????? ?????? ???????????? ????????? ????????? ???????????? ?????? ????????? ?????? ?????????????????? ?????? ????????? (Data) ?????? ???????????? ?????????????????? ?????? ????????????????????? (Pointer) ???????????? ????????? ???????????? ?????? ?????????????????? ??????????????????????????? ???????????? ?????? ?????? ???????????????????????? ?????? ????????? ????????? ?????????????????? ?????????
Why is a linked list better in Hindi? - ?????????????????? ??????????????? ??????????????? ??????????????? ???????
Linked List ????????? Insertion (????????? ????????? ??????????????????) ?????? Deletion (?????????????????? ????????? ???????????????) ???????????? ???????????? ????????? ??????????????? Array ?????? ????????? ???????????? ??????????????????????????? ?????? ??????????????? ???????????? ?????? ??????????????? ???????????? ???????????????, ??????????????? ?????????????????? ???????????? ?????? ??????????????????-???????????? ???????????? ?????????
Insertion and Deletion in Linked List in Hindi - ?????????????????? ??????????????? ????????? ????????????????????? ?????? ??????????????????
Insertion in Linked List: ????????? ?????????????????? ?????? ???????????????????????????
Insertion ?????? ???????????? ???????????? ?????? - ?????? ????????? ????????? ?????????????????? ??????????????? ????????? ????????????????????? ?????? ??????????????????????????? ????????? ????????????????????? ????????????????????? ?????? ?????? ???????????? ??????:
- ??????????????? ?????? ?????????????????? ????????? (Beginning)
- ??????????????? ?????? ????????? ????????? (End)
- ??????????????? ?????? ????????? ????????? ???????????? ??????????????? ?????????????????? ?????? (Specific Position)
???????????????-?????????-??????????????? ??????????????????????????? (Insertion at Beginning)
- ????????? ????????? ??????????????? ?????? ??????????????? ?????????????????? ???????????? ??????????????? ???????????????
- ?????? ????????? ?????? ?????????????????? ?????????????????? ????????? (???????????? ?????????) ?????? ?????? ??????????????? ????????????
- ?????? ????????? ?????? ??????????????? ?????? ?????? ????????? ?????? ??????????????? ??????????????????
??????????????????: ????????? ??????????????? ?????? [10 -> 20 -> 30], ?????? ?????? 5 ?????????????????? ??????????????? ?????????, ?????? ?????? ??????????????? ???????????? [5 -> 10 -> 20 -> 30]
Deletion in Linked List: ????????? ??????????????? ?????? ???????????????????????????
Deletion ?????? ???????????? ?????? - ?????????????????? ??????????????? ?????? ???????????? ????????? ?????? ?????????????????? ?????? ????????? ?????????-????????? ????????????????????? ?????? ???????????? ?????? ???????????? ??????:
- ??????????????? ?????? ?????????????????? ?????? (Beginning Deletion)
- ??????????????? ?????? ????????? ?????? (End Deletion)
- ??????????????? ?????? ????????? ?????? ???????????? ????????? ?????????????????? ?????? (Position-Based Deletion)
???????????????-?????????-??????????????? ??????????????????????????? (Deletion from Beginning)
- ????????? ????????? ?????? ??????????????????????????? ????????????????????? ????????? ??????????????? ???????????????
- ????????? ?????? ???????????? ????????? ?????? ??????????????? ???????????? ???????????? ????????? ????????? ????????? ????????????
- ?????? ????????? ??????????????? ???????????? ????????? ??????, ????????? ??????????????? ?????? ????????? (free/delete)
??????????????????: ????????? ??????????????? ?????? [5 -> 10 -> 20 -> 30], ?????? ?????? ????????? (5) ??????????????? ?????????, ?????? ?????? ??????????????? ???????????? [10 -> 20 -> 30]
C ?????????: Insertion ?????? Deletion
???????????? Linked List ????????? ?????????????????? ????????? Insertion ?????? Deletion ?????? C ????????? ??????, ?????? ????????? ?????? ??????????????????-???????????????????????? ??????:
Input: C
#include <stdio.h>
#include <stdlib.h>
// Node structure
struct Node {
int data;
struct Node* next;
};
// Insert at Beginning
struct Node* insertAtStart(struct Node* head, int newData) {
struct Node* newNode = (struct Node*)malloc(sizeof(struct Node));
if (newNode == NULL) {
printf("Memory allocation failed\n");
return head;
}
newNode->data = newData;
newNode->next = head;
return newNode; // direct return (cleaner)
}
// Delete at Beginning
struct Node* deleteAtStart(struct Node* head) {
if (head == NULL) {
printf("List already empty\n");
return NULL;
}
struct Node* temp = head;
head = head->next;
free(temp);
return head;
}
// Print List
void printList(struct Node* head) {
if (head == NULL) {
printf("List is empty\n");
return;
}
struct Node* current = head;
while (current != NULL) {
printf("%d -> ", current->data);
current = current->next;
}
printf("NULL\n");
}
// Main function
int main() {
struct Node* head = NULL;
// Insertion
head = insertAtStart(head, 30);
head = insertAtStart(head, 20);
head = insertAtStart(head, 10);
printf("List after insertion: ");
printList(head);
// Deletion
head = deleteAtStart(head);
printf("List after deletion: ");
printList(head);
return 0;
}
Output:
Plain
??????????????? Insertion ?????? ?????????: 10 -> 20 -> 30 -> NULL
??????????????? Deletion ?????? ?????????: 20 -> 30 -> NULL
Description:
- ????????? ?????????
insertAtStart?????????????????? ????????? ????????? ???????????? ????????? ?????????????????? ????????? deleteAtStart?????????????????? ????????? ????????? ?????? ??????????????? ?????????printList??????????????? ?????? ?????????????????? ???????????? ?????????
Linked List ????????? Insertion ?????? Deletion ?????? ????????????-?????????????????? ?????????
Linked List ????????? Insertion ?????? Deletion ?????? ??????????????? ?????? ????????? ???????????? ??????:
Advantages:
- ???????????????????????? ????????????: ??????????????? ?????? ??????????????? ?????? ??????????????? ?????? ??????????????? ?????? ???????????? ?????????
- ????????? ????????????????????????: ????????? ?????? ??????????????? ????????? Insertion ?????? Deletion ????????????
Disadvantages:
- ??????????????? ?????????????????? ????????????: ???????????? ????????? ????????? ?????? ????????????????????? ????????? ????????? ???????????? ?????????
- ?????????????????? ??????????????????: ???????????????????????? ?????? ????????? ???????????????????????? ????????? ??????????????????
??????????????????: ?????? ?????? ????????????????????? ?????????????????? ????????? ???????????? ?????? ??????????????????????????? ??????????????? ?????????, ?????? Linked List ?????? ??????????????? ???????????? ?????????????????? (Insertion) ?????? ??????????????? (Deletion) ?????? ????????? ???????????? ?????????
Tips and use of the future in Hindi - ??????????????? ?????? ?????????????????? ?????? ???????????????
??????????????? (Tips):
- ???????????? ??????????????? ?????? ????????? Linked List ????????? ????????????, ???????????? ?????????-????????? Insertion/Deletion ?????????
- ????????? ????????? ?????????????????? ????????? ?????? ???????????? ?????? ????????? free ?????? ??????????????? ???????????????
- ????????? ?????????????????? ??????????????? ????????? ???????????? ????????? ???????????? ?????? ?????? ????????????????????? ??????????????????
??????????????????: Linked List ?????? ??????????????? ?????????????????????, ????????????????????? ?????????????????????????????????, ?????? ???????????????????????? ???????????????????????? ????????? ???????????? ????????? ?????????????????? ?????????, AI ???????????????????????? ????????? ???????????????????????? ???????????? ??????????????????????????? ?????? ????????? ???????????? ??????????????? ??????????????????
???????????????????????? (Conclusion)
Insertion ?????? Deletion in Linked List ???????????? ?????? ?????????????????????????????? ??????????????? ???????????? ?????? ?????? ?????????????????? ??????????????? ????????? ??????????????? ?????? ????????????????????? ?????? ?????????, ?????? ??????????????? ?????? ??????????????? ?????? ????????? ?????? ????????? ???????????? ???????????? ?????? ??????????????? ????????? ???????????? ???????????????????????????, ?????? ????????? ?????? ????????? ????????? ??????????????? ????????? ?????? Linked List ?????? ???????????? ????????????????????????????????? ?????? ???????????? ????????? ?????? ??????????????? ??????????????? ?????????, ?????? ???????????? ??????????????? ????????????!