12. LINKED LIST [DOUBLY]: INSERT at given POSITION [ANIMATED] with CODE | Data Structure Full Course
This video is explains the code in C language, how to insert a node at a given position of a linked list.
The algorithm:
INSLOC(INFO, LINK, START, AVAIL, LOC, ITEM)
This algorithm inserts ITEM so that ITEM follows the node with location LOC or inserts ITEM as the first node when LOC = NULL.
1. [OVERFLOW?] If AVAIL = NULL, then: Write: OVERFLOW, and Exit.
2. [Remove first node from AVAIL list.]
Set NEW : = AVAIL and AVAIL: = LINK[AVAIL].
3. Set INFO[NEW] := ITEM. [Copies new data into new node.]
4. If LOC = NULL, then: [Insert as first node.]
Set LINK[NEW]:= START and START:= NEW.
Else: [Insert after node with location LOC.]
Set LINK[NEW] : = LINK[LOC] and LINK[LOC] : = NEW.
[End of If structure.]
5. Exit.
Source: Theories and problems of Data Structures by SEYMOUR LIPSCHUTZ, McGRAW-HILL B00K COMPANY [2004], pp. 132.
My socials:
psnacademy.in@gmail.com
https://psnacademy.in
https://www.patreon.com/psnayak
https://www.instagram.com/psnayakeducator/
https://www.buymeacoffee.com/psnayak
https://twitter.com/psnayak2007
Note: This video is copyrighted, no part of it to be reproduced or republished.
Видео 12. LINKED LIST [DOUBLY]: INSERT at given POSITION [ANIMATED] with CODE | Data Structure Full Course канала PSN Academy
The algorithm:
INSLOC(INFO, LINK, START, AVAIL, LOC, ITEM)
This algorithm inserts ITEM so that ITEM follows the node with location LOC or inserts ITEM as the first node when LOC = NULL.
1. [OVERFLOW?] If AVAIL = NULL, then: Write: OVERFLOW, and Exit.
2. [Remove first node from AVAIL list.]
Set NEW : = AVAIL and AVAIL: = LINK[AVAIL].
3. Set INFO[NEW] := ITEM. [Copies new data into new node.]
4. If LOC = NULL, then: [Insert as first node.]
Set LINK[NEW]:= START and START:= NEW.
Else: [Insert after node with location LOC.]
Set LINK[NEW] : = LINK[LOC] and LINK[LOC] : = NEW.
[End of If structure.]
5. Exit.
Source: Theories and problems of Data Structures by SEYMOUR LIPSCHUTZ, McGRAW-HILL B00K COMPANY [2004], pp. 132.
My socials:
psnacademy.in@gmail.com
https://psnacademy.in
https://www.patreon.com/psnayak
https://www.instagram.com/psnayakeducator/
https://www.buymeacoffee.com/psnayak
https://twitter.com/psnayak2007
Note: This video is copyrighted, no part of it to be reproduced or republished.
Видео 12. LINKED LIST [DOUBLY]: INSERT at given POSITION [ANIMATED] with CODE | Data Structure Full Course канала PSN Academy
Комментарии отсутствуют
Информация о видео
10 июня 2022 г. 10:15:17
00:16:53
Другие видео канала