Linked list, pertemuan 2 dan 3

Linked list is a data structure that consist of a sequence of data records such that each record there is a field that contain a eference to the next record in the sequence
3 types :-
- single
- double
- multiple
in single list we can create a pointer that can point in one direction, a double linked list we can point to two direction, while a multiple linked list can point to more than two.
code snippet for a double linked list.
in a single linked list we only have one pointer for ex:-
struct tnode *next;
there is 2 methods of a linked list, insert and delete.
in the code snippet we have insert, to insert a new node and free all node starting from the head.
we can free from the head, tail or free a certain type of node. most of the explanation of how these 2 functions work is explained in the screenshot.

Komentar

Postingan populer dari blog ini

AVL and B3