Singly Linked List

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 3

Lagarto, Giandro R.

SBIT – 2F
SINGLY LINKED LIST
1. Head = 150H – XY
2. Tail = 120H – Z
3. Insert 250H XY after 150H
4. Insert 350H YZ before 250H after 150H
5. Insert 450H QP at the front
6. Insert 500H XU at the end
7. Insert 700H wx after 450H
8. Delete 150h

XY 120H Z NULL
150H 120H

XY 250H XY 120H Z NULL


150H 250H 120H

XY 350 YZ 250H XY 120H Z NULL


150H 350H 250H 120H

QP 150H XY 350 YZ 250H XY 120H Z NULL


450H 150H 350H 250H 120H

QP 150H XY 350H YZ 250H XY 120H Z 500H XU NULL


450H 150H 350H 250H 120H 500H

QP 700H WX 150H XY 350H YZ 250H XY 120H Z 500H XU NULL


450H 700H 150H 350H 250H 120H 500H

QP 700H WX 150H YZ 250H XY 120H Z 500H XU NULL


450H 700H 350 250H 120H 500H
Lagarto, Giandro R.
SBIT – 2F

DOUBLY LINKED LIST


1. Head = ML – 25H 10. Insert QL 19H at 28H
2. Tail = NO -30H 11. Insert MN 38H after 19H
3. Insert 26H PQ at 25H 12. Insert OQ 49H after 45H
4. Insert 27H OP after 26H 13. Delete 45H
5. Insert RS 35H at the front
6. Insert TV 45H at the end
7. Insert ILY with 55H after 27H before 30H
8. Insert UV 28H after 55H
9. Delete 55H “ILY”

NULL ML 30H 25H NO NULL


25H 30H

NULL ML 26H 25H PQ 30H 26H NO NULL


25H 26H 30H
6
NULL ML 26H 25H PQ 27H 26H OP 30H 27H NO NULL
25H 26H 27H 30H

NULL RS 25H 35H ML 26H 25H PQ 27H 26H OP 30H 27H NO NULL
35H 25H 26H 27H 30H

NULL RS 25H 35H ML 26H 25H PQ 27H 26H OP 30H 27H NO 45H
35H 25H 26H 27H 30H

NULL TV 30H
45H

NULL RS 25H 35H ML 26H 25H PQ 27H 26H OP 55H 27H ILY 30H
35H 25H 26H 27H 55H

NULL TV 30H 45H NO 55H


45H 30H
Lagarto, Giandro R.
SBIT – 2F

NULL RS 25H 35H ML 26H 25H PQ 27H 26H OP 55H 27H ILY 28H
35H 25H 26H 27H 55H

NULL TV 30H 45H NO 28H 30H VY 55H


45H 30H 28H

NULL RS 25H 35H ML 26H 25H PQ 27H 26H OP 28H 27H VY 30H
35H 25H 26H 27H 28H

NULL TV 30H 45H 28H


45H 30H

NULL RS 25H 35H ML 26H 25H PQ 27H 26H OP 28H 27H VY 19H
35H 25H 26H 27H 28H

NULL TV 30H 45H NO 19H 30H QL 28H


45H 30H 19H

NULL RS 25H 35H ML 26H 25H PQ 27H 26H OP 28H 27H VY 19H
35H 25H 26H 27H 28H

NULL TV 30H 45H NO 38H 30H MN 19H 38H QL 28H


45H 30H 38H 19H

NULL RS 25H 35H ML 26H 25H PQ 27H 26H OP 28H 27H VY 19H
35H 25H 26H 27H 28H

NULL OQ 45H 49H TV 30H 45H NO 38H 30H MN 19H 38H QL 28H
49H 45H 30H 38H 19H

NULL RS 45H NULL ML 45H NULL PQ 45H NULL OP 45H NULL VY 45H
35H 25H 26H 27H 28H

NULL OQ 45H NULL NO 45H NULL MN 45H NULL QL 45H


49H 30H 38H 19H

You might also like